Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that disables it given conditions:
- (os == "linux") and (bits == 32) and debug : https://bugzilla.mozilla.org/show_bug.cgi?id=1483696
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html - WPT Dashboard Interop Dashboard
<!doctype html>
<html>
<head>
<title>Auxiliary Browsing Contexts: window.opener setter</title>
<meta name=timeout content=long>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/PrefixedLocalStorage.js"></script>
</head>
<body>
<div id="log"></div>
<script>
var prefixedLocalStorage;
setup(() => prefixedLocalStorage = new PrefixedLocalStorageTest());
async_test(t => {
t.add_cleanup(() => prefixedLocalStorage.cleanup());
prefixedLocalStorage.onSet('openerIsNull', t.step_func_done(e => {
assert_equals(e.newValue, 'true');
}));
window.open(prefixedLocalStorage.url('resources/opener-setter.html'),
'iShouldSetOpenerToNull');
}, 'Auxiliary browsing context created via `window.open` and setting `window.opener` to `null` should report `window.opener` `null`');
async_test(t => {
t.add_cleanup(() => prefixedLocalStorage.cleanup());
prefixedLocalStorage.onSet('openerIsTest', t.step_func_done(e => {
assert_equals(e.newValue, 'true');
}));
window.open(prefixedLocalStorage.url('resources/opener-setter.html'),
'iShouldSetOpenerToTest');
}, 'Auxiliary browsing context created via `window.open` and setting `window.opener` to `test` should report `test`');
</script>
</body>
</html>