https://github.com/web-platform-tests/wpt
Raw File
Tip revision: e1321f59e821319d86425ee9027458ff9db35b05 authored by Jaewon Choi on 22 October 2018, 16:31:16 UTC
Add SameObject attribute to navigator xr with wpt
Tip revision: e1321f5
block-string-assignment-to-Location-replace.tentative.html
<!DOCTYPE html>
<html>
<head>
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
  <script src="support/helper.sub.js"></script>

  <meta http-equiv="Content-Security-Policy" content="trusted-types *">
</head>
<body>
<script>
  // TrustedURL replacements do not throw.
  test(t => {
    let p = createURL_policy(window, 1);
    let url = p.createURL(location.href + "#xxx");
    location.replace(url);
    assert_equals("" + url, location.href, "location href");
  }, "location.replace via policy (successful URL transformation).");

  // String replacements throw.
  test(t => {
    assert_throws(new TypeError(), _ => {
      location.replace("A string");
    });
  }, "`location.replace = string` throws");

  // Null replacement throws.
  test(t => {
    assert_throws(new TypeError(), _ => {
      location.replace(null);
    });
  }, "`location.replace = null` throws");
</script>
back to top