Reviewed by Darin.
[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         } else {
15             document.body.innerText = 'FAIL: window.open failed to make a window.';
16             if (window.layoutTestController)
17                 layoutTestController.notifyDone();
18         }
19     }
20
21     function done() {
22         if (window.layoutTestController)
23             if (layoutTestController.windowCount() == 1)
24                 layoutTestController.notifyDone();
25             else
26                 setTimeout("done()", 100);
27     }
28
29     function pass() {
30         document.body.innerText = 'PASS';
31         newWindow.close();
32         done();
33     }
34
35     function fail() {
36         document.body.innerText = 'FAIL';
37         newWindow.close();
38         done();
39     }
40     </script>
41 </head>
42 <body onload="test()">
43 FAIL: TEST DID NOT RUN!
44 </body>
45 </html>