| OLD | NEW |
| (Empty) |
| 1 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."
); | |
| 2 | |
| 3 if (window.testRunner) { | |
| 4 testRunner.waitUntilDone(); | |
| 5 testRunner.setCanOpenWindows(); | |
| 6 } | |
| 7 | |
| 8 var testWindow = open("data:text/plain,a"); | |
| 9 | |
| 10 // Note that the window does not navigate to the new URL right away, and that is
a crucial element | |
| 11 // of the test. We're checking behavior when the object was just created and is
not yet at its new | |
| 12 // location. | |
| 13 | |
| 14 shouldBe("testWindow.location.toString()", "'about:blank'"); | |
| 15 shouldBe("testWindow.location.href", "'about:blank'"); | |
| 16 shouldBe("testWindow.location.protocol", "'about:'"); | |
| 17 shouldBe("testWindow.location.host", "''"); // Firefox throws an exception | |
| 18 shouldBe("testWindow.location.hostname", "''"); // Firefox throws an exception | |
| 19 shouldBe("testWindow.location.port", "''"); | |
| 20 shouldBe("testWindow.location.pathname", "'blank'"); // Firefox returns the empt
y string | |
| 21 shouldBe("testWindow.location.search", "''"); | |
| 22 shouldBe("testWindow.location.hash", "''"); | |
| 23 | |
| 24 shouldBe("testWindow.location.href = 'data:text/plain,b'", "'data:text/plain,b'"
); | |
| 25 shouldBe("testWindow.location.protocol = 'data'", "'data'"); // Firefox throws a
n exception | |
| 26 shouldBe("testWindow.location.host = 'c'", "'c'"); // Firefox throws an exceptio
n | |
| 27 shouldBe("testWindow.location.hostname = 'd'", "'d'"); // Firefox throws an exce
ption | |
| 28 shouldBe("testWindow.location.port = 'e'", "'e'"); // Firefox throws an exceptio
n | |
| 29 shouldBe("testWindow.location.pathname = 'f'", "'f'"); // Firefox throws an exce
ption | |
| 30 shouldBe("testWindow.location.search = 'g'", "'g'"); | |
| 31 shouldBe("testWindow.location.hash = 'h'", "'h'"); | |
| 32 | |
| 33 shouldBe("testWindow.location.assign('data:text/plain,i')", "undefined"); | |
| 34 shouldBe("testWindow.location.replace('data:text/plain,j')", "undefined"); | |
| 35 shouldBe("testWindow.location.reload()", "undefined"); | |
| 36 | |
| 37 shouldBe("testWindow.location.toString()", "'about:blank'"); | |
| 38 shouldBe("testWindow.location.href", "'about:blank'"); | |
| 39 shouldBe("testWindow.location.protocol", "'about:'"); | |
| 40 shouldBe("testWindow.location.host", "''"); // Firefox throws an exception | |
| 41 shouldBe("testWindow.location.hostname", "''"); // Firefox throws an exception | |
| 42 shouldBe("testWindow.location.port", "''"); | |
| 43 shouldBe("testWindow.location.pathname", "'blank'"); // Firefox returns the empt
y string | |
| 44 shouldBe("testWindow.location.search", "''"); | |
| 45 shouldBe("testWindow.location.hash", "''"); | |
| 46 | |
| 47 testWindow.close(); | |
| 48 | |
| 49 if (window.testRunner) { | |
| 50 function doneHandler() | |
| 51 { | |
| 52 if (testWindow.closed) { | |
| 53 testRunner.notifyDone(); | |
| 54 return; | |
| 55 } | |
| 56 setTimeout(doneHandler, 0); | |
| 57 } | |
| 58 doneHandler(); | |
| 59 } | |
| OLD | NEW |