| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script src="script-tests/location-new-window-no-crash.js"></script> | 7 <script> |
| 8 description("Tests that manipulating location properties in a just-created windo
w object does not crash. Note: Turn off pop-up blocking to run this in-browser."
); |
| 9 |
| 10 if (window.testRunner) { |
| 11 testRunner.waitUntilDone(); |
| 12 testRunner.setCanOpenWindows(); |
| 13 } |
| 14 |
| 15 var testWindow = open("data:text/plain,a"); |
| 16 |
| 17 // Note that the window does not navigate to the new URL right away, and that is
a crucial element |
| 18 // of the test. We're checking behavior when the object was just created and is
not yet at its new |
| 19 // location. |
| 20 |
| 21 shouldBe("testWindow.location.toString()", "'about:blank'"); |
| 22 shouldBe("testWindow.location.href", "'about:blank'"); |
| 23 shouldBe("testWindow.location.protocol", "'about:'"); |
| 24 shouldBe("testWindow.location.host", "''"); // Firefox throws an exception |
| 25 shouldBe("testWindow.location.hostname", "''"); // Firefox throws an exception |
| 26 shouldBe("testWindow.location.port", "''"); |
| 27 shouldBe("testWindow.location.pathname", "'blank'"); // Firefox returns the empt
y string |
| 28 shouldBe("testWindow.location.search", "''"); |
| 29 shouldBe("testWindow.location.hash", "''"); |
| 30 |
| 31 shouldBe("testWindow.location.href = 'data:text/plain,b'", "'data:text/plain,b'"
); |
| 32 shouldBe("testWindow.location.protocol = 'data'", "'data'"); // Firefox throws a
n exception |
| 33 shouldBe("testWindow.location.host = 'c'", "'c'"); // Firefox throws an exceptio
n |
| 34 shouldBe("testWindow.location.hostname = 'd'", "'d'"); // Firefox throws an exce
ption |
| 35 shouldBe("testWindow.location.port = 'e'", "'e'"); // Firefox throws an exceptio
n |
| 36 shouldBe("testWindow.location.pathname = 'f'", "'f'"); // Firefox throws an exce
ption |
| 37 shouldBe("testWindow.location.search = 'g'", "'g'"); |
| 38 shouldBe("testWindow.location.hash = 'h'", "'h'"); |
| 39 |
| 40 shouldBe("testWindow.location.assign('data:text/plain,i')", "undefined"); |
| 41 shouldBe("testWindow.location.replace('data:text/plain,j')", "undefined"); |
| 42 shouldBe("testWindow.location.reload()", "undefined"); |
| 43 |
| 44 shouldBe("testWindow.location.toString()", "'about:blank'"); |
| 45 shouldBe("testWindow.location.href", "'about:blank'"); |
| 46 shouldBe("testWindow.location.protocol", "'about:'"); |
| 47 shouldBe("testWindow.location.host", "''"); // Firefox throws an exception |
| 48 shouldBe("testWindow.location.hostname", "''"); // Firefox throws an exception |
| 49 shouldBe("testWindow.location.port", "''"); |
| 50 shouldBe("testWindow.location.pathname", "'blank'"); // Firefox returns the empt
y string |
| 51 shouldBe("testWindow.location.search", "''"); |
| 52 shouldBe("testWindow.location.hash", "''"); |
| 53 |
| 54 testWindow.close(); |
| 55 |
| 56 if (window.testRunner) { |
| 57 function doneHandler() |
| 58 { |
| 59 if (testWindow.closed) { |
| 60 testRunner.notifyDone(); |
| 61 return; |
| 62 } |
| 63 setTimeout(doneHandler, 0); |
| 64 } |
| 65 doneHandler(); |
| 66 } |
| 67 </script> |
| 8 </body> | 68 </body> |
| 9 </html> | 69 </html> |
| OLD | NEW |