781a9b9f248200e07bac333b9b7d394ed1915214
[WebKit-https.git] / LayoutTests / fast / dom / Document / early-document-access.html
1 <html>
2 <head>
3     <script>
4     function test() {
5         if (window.layoutTestController) {
6             layoutTestController.setCanOpenWindows();
7             layoutTestController.dumpAsText();
8             layoutTestController.waitUntilDone();
9         }
10
11         newWindow = window.open('resources/early-document-access-popup.html');
12         if (newWindow) {
13             newWindow.document; // access the document
14             setTimeout(fail, 5000); // fail if we take longer than 5 seconds
15         } else {
16             document.body.innerText = 'FAIL: window.open failed to make a window.';
17             layoutTestController.notifyDone();
18         }
19     }
20
21     function done() {
22         newWindow.close();
23         if (window.layoutTestController)
24             setTimeout("layoutTestController.notifyDone()", 100);
25     }
26
27     function pass() {
28         document.body.innerText = 'PASS';
29         done();
30     }
31
32     function fail() {
33         document.body.innerText = 'FAIL';
34         done();
35     }
36     </script>
37 </head>
38 <body onload="test()">
39 FAIL: TEST DID NOT RUN!
40 </body>
41 </html>