diff options
Diffstat (limited to 'testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html')
-rw-r--r-- | testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html new file mode 100644 index 0000000000..ac6e47b846 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html @@ -0,0 +1,33 @@ +<!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> |