https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 4ed222f683a26ea90dcb5eef36cf3ea9c8ef65a0 authored by Josh Matthews on 12 September 2018, 16:20:36 UTC
Work around lint failure.
Tip revision: 4ed222f
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