Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / misc / set-window-opener-to-null.html
blob60a2d4bc404a5c24f7185c80b4a1cbad19b26b71
1 <html>
2 <script>
3 if (window.testRunner) {
4 testRunner.setCanOpenWindows();
5 testRunner.dumpAsText();
6 testRunner.waitUntilDone();
9 function runTest() {
10 var e = document.getElementById('console');
11 e.innerHTML = w.opener == null ? 'PASS' : 'FAIL';
13 w.close();
15 if (window.testRunner)
16 testRunner.notifyDone();
19 var w = window.open('http://127.0.0.1:8000/misc/resources/content-iframe.html');
20 w.opener = null;
21 w.onload = runTest;
22 </script>
23 <body>
24 This tests that following code works in Chrome:
25 <pre>
26 var w = window.open(...);
27 w.opener = null;
28 </pre>
29 After new page finishes loading, its opener should stay as null.
31 <p>
32 <div id="console">Running ...<div>
33 </body>
34 </html>