OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="resources/cross-frame-access.js"></script> | 3 <script src="resources/cross-frame-access.js"></script> |
4 <script> | 4 <script> |
5 window.onload = function() | 5 window.onload = function() |
6 { | 6 { |
7 if (window.testRunner) { | 7 if (window.testRunner) { |
8 testRunner.dumpAsText(); | 8 testRunner.dumpAsText(); |
9 testRunner.waitUntilDone(); | 9 testRunner.waitUntilDone(); |
10 } | 10 } |
11 | 11 |
12 if (window.testRunner) { | 12 window.addEventListener('message', function () |
13 setTimeout(pollForTest, 1); | 13 { |
14 } else { | 14 runTest(); |
15 log("To run the test, click the button below when the frame wind
ow finishes loading."); | 15 if (window.testRunner) |
16 var button = document.createElement("button"); | 16 testRunner.notifyDone(); |
17 button.appendChild(document.createTextNode("Run Test")); | 17 }); |
18 button.onclick = runTest; | |
19 document.body.appendChild(button); | |
20 } | |
21 } | |
22 | |
23 pollForTest = function() | |
24 { | |
25 if (!testRunner.globalFlag) { | |
26 setTimeout(pollForTest, 1); | |
27 return; | |
28 } | |
29 runTest(); | |
30 testRunner.notifyDone(); | |
31 } | 18 } |
32 | 19 |
33 runTest = function() | 20 runTest = function() |
34 { | 21 { |
35 window.targetWindow = frames[0]; | 22 window.targetWindow = frames[0]; |
36 | 23 |
37 log("\n----- tests for getting window.location's properties -----\n"
); | 24 log("\n----- tests for getting window.location's properties -----\n"
); |
38 | 25 |
39 shouldBeTrue("canGet('targetWindow.location')"); | 26 shouldBeTrue("canGet('targetWindow.location')"); |
40 shouldBe("toString('targetWindow.location', '')", "''"); | 27 shouldBe("toString('targetWindow.location', '')", "''"); |
(...skipping 29 matching lines...) Expand all Loading... |
70 shouldBeTrue("canGet('targetWindow.location.replace')"); | 57 shouldBeTrue("canGet('targetWindow.location.replace')"); |
71 | 58 |
72 } | 59 } |
73 </script> | 60 </script> |
74 </head> | 61 </head> |
75 <body> | 62 <body> |
76 <iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for
-location-get-test.html"></iframe> | 63 <iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for
-location-get-test.html"></iframe> |
77 <pre id="console"></pre> | 64 <pre id="console"></pre> |
78 </body> | 65 </body> |
79 </html> | 66 </html> |
OLD | NEW |