| <!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> |