2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / LayoutTests / fast / dom / Window / window-early-properties.html
blobaf50c976217bd7dd72ab7010eaaa5144742af007
1 <html>
2 <body onload='test()'>
3 <script>
4 if (window.layoutTestController) {
5 layoutTestController.dumpAsText();
6 layoutTestController.setCanOpenWindows();
7 layoutTestController.waitUntilDone();
10 var w;
12 function test()
14 w = window.open("resources/opened-window.html");
15 w.myProp = "1";
16 w.document.myProp = "2";
19 // Called from the opened window.
20 function concludeTest()
22 var c = document.getElementById('console');
23 c.innerHTML = "window retains early properties: " + ((w.myProp && w.myProp=='1') ? "PASS" : "FAIL") + "<br>";
24 c.innerHTML +="document does not retain early properties: " + ((w.document.myProp) ? "FAIL" : "PASS") + "<br>";
26 w.close();
27 setTimeout(doneHandler, 1);
28 function doneHandler() {
29 if (w.closed) {
30 if (window.layoutTestController)
31 layoutTestController.notifyDone();
32 return;
35 setTimeout(doneHandler, 1);
39 </script>
40 Test setting window properties right after window.open()
41 <div id='console'>FAIL, test did not run</div>
42 </body>
43 </html>