| 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 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 { | 34 { |
| 35 window.targetWindow = frames[0]; | 35 window.targetWindow = frames[0]; |
| 36 | 36 |
| 37 log("\n----- tests for getting window.location's properties -----\n"
); | 37 log("\n----- tests for getting window.location's properties -----\n"
); |
| 38 | 38 |
| 39 shouldBeTrue("canGet('targetWindow.location')"); | 39 shouldBeTrue("canGet('targetWindow.location')"); |
| 40 shouldBe("toString('targetWindow.location', '')", "''"); | 40 shouldBe("toString('targetWindow.location', '')", "''"); |
| 41 | 41 |
| 42 log("Firefox allows access to 'location.toString' but throws an exce
ption when you call it."); | 42 log("Firefox allows access to 'location.toString' but throws an exce
ption when you call it."); |
| 43 shouldBeFalse("canGet('targetWindow.location.toString')"); | 43 shouldBeFalse("canGet('targetWindow.location.toString')"); |
| 44 shouldBeTrue("accessThrowsException('targetWindow.location.toString'
)"); |
| 44 | 45 |
| 45 shouldBeFalse("canGet('targetWindow.location.href')"); | 46 shouldBeFalse("canGet('targetWindow.location.href')"); |
| 46 shouldBeFalse("canGet('targetWindow.location.hash')"); | 47 shouldBeFalse("canGet('targetWindow.location.hash')"); |
| 47 shouldBeFalse("canGet('targetWindow.location.host')"); | 48 shouldBeFalse("canGet('targetWindow.location.host')"); |
| 48 shouldBeFalse("canGet('targetWindow.location.hostname')"); | 49 shouldBeFalse("canGet('targetWindow.location.hostname')"); |
| 49 shouldBeFalse("canGet('targetWindow.location.pathname')"); | 50 shouldBeFalse("canGet('targetWindow.location.pathname')"); |
| 50 shouldBeFalse("canGet('targetWindow.location.port')"); | 51 shouldBeFalse("canGet('targetWindow.location.port')"); |
| 51 shouldBeFalse("canGet('targetWindow.location.protocol')"); | 52 shouldBeFalse("canGet('targetWindow.location.protocol')"); |
| 52 shouldBeFalse("canGet('targetWindow.location.search')"); | 53 shouldBeFalse("canGet('targetWindow.location.search')"); |
| 54 shouldBeFalse("canGet('targetWindow.location.existingCustomProperty'
)"); |
| 55 shouldBeFalse("canGet('targetWindow.location[1]')"); |
| 56 |
| 57 shouldBeTrue("accessThrowsException('targetWindow.location.href')"); |
| 58 shouldBeTrue("accessThrowsException('targetWindow.location.hash')"); |
| 59 shouldBeTrue("accessThrowsException('targetWindow.location.host')"); |
| 60 shouldBeTrue("accessThrowsException('targetWindow.location.hostname'
)"); |
| 61 shouldBeTrue("accessThrowsException('targetWindow.location.pathname'
)"); |
| 62 shouldBeTrue("accessThrowsException('targetWindow.location.port')"); |
| 63 shouldBeTrue("accessThrowsException('targetWindow.location.protocol'
)"); |
| 64 shouldBeTrue("accessThrowsException('targetWindow.location.search')"
); |
| 65 shouldBeTrue("accessThrowsException('targetWindow.location.existingC
ustomProperty')"); |
| 66 shouldBeTrue("accessThrowsException('targetWindow.location[1]')"); |
| 53 | 67 |
| 54 shouldBeTrue("canGet('targetWindow.location.assign')"); | 68 shouldBeTrue("canGet('targetWindow.location.assign')"); |
| 55 shouldBeTrue("canGet('targetWindow.location.reload')"); | 69 shouldBeTrue("canGet('targetWindow.location.reload')"); |
| 56 shouldBeTrue("canGet('targetWindow.location.replace')"); | 70 shouldBeTrue("canGet('targetWindow.location.replace')"); |
| 57 | 71 |
| 58 shouldBeFalse("canGet('targetWindow.location.existingCustomProperty'
)"); | |
| 59 } | 72 } |
| 60 </script> | 73 </script> |
| 61 </head> | 74 </head> |
| 62 <body> | 75 <body> |
| 63 <iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for
-location-get-test.html"></iframe> | 76 <iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for
-location-get-test.html"></iframe> |
| 64 <pre id="console"></pre> | 77 <pre id="console"></pre> |
| 65 </body> | 78 </body> |
| 66 </html> | 79 </html> |
| OLD | NEW |