blob: 172d566e57fc635b551b5d355661db690869b220 [file] [log] [blame]
<!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>