https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 8f8ad6af8a593f90f26a1db53aea63f89d000c10 authored by Seth Hampson on 28 March 2018, 23:35:04 UTC
Updating tests to test no stream ids and multiple stream ids.
Tip revision: 8f8ad6a
location-href.tentative.html
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="./support/helper.js"></script>
<body>
<script>
  promise_test(t => {
    var url = TrustedURL.create(URLS.safe);
    return createFrameAndHref(url);
  }, "Basic processing: safe URL, safe construction.");

  promise_test(t => {
    var url = TrustedURL.unsafelyCreate(URLS.safe);
    return createFrameAndHref(url);
  }, "Basic processing: safe URL, unsafe construction.");

  promise_test(t => {
    var url = TrustedURL.create(URLS.javascript);
    return createFrameAndHref(url).then(i => {
      assert_equals(i.contentDocument.body.innerText, "");
    });
  }, "Basic processing: javascript URL, safe construction.");

  promise_test(t => {
    var url = TrustedURL.unsafelyCreate(URLS.javascript);
    return createFrameAndHref(url).then(i => {
      assert_equals(i.contentDocument.body.innerText, "scripted");
    });
  }, "Basic processing: javascript URL, unsafe construction.");
</script>
back to top