https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 948619e9aa2e43a6ca81d3bfc78669a721207523 authored by Philip Jägenstedt on 12 November 2018, 21:22:18 UTC
Find manifest for download by tags instead of commits
Tip revision: 948619e
Window-open.tentative.html
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/helper.sub.js"></script>
<body>
<script>
  // helper functions for the tests
  function testWindowOpen(t, win, testNumber) {
    let p = createURL_policy(window, testNumber);
    let url = p.createURL(INPUTS.URL);
    let child_window = win.open(url, "", "");
    child_window.onload = t.step_func_done(_ => {
      assert_equals(child_window.location.href, "" + url);
      child_window.close();
    });
  }

  test(t => {
    testWindowOpen(t, window, 1);
  }, "window.open via policy (successful URL transformation).");

  test(t => {
    testWindowOpen(t, document, 2);
  }, "document.open via policy (successful URL transformation).");
</script>
back to top