5 if (window
.testRunner
) {
6 testRunner
.clearBackForwardList();
7 testRunner
.dumpAsText();
12 document
.getElementById("logger").innerText
+= txt
+ "\n";
18 history
.pushState(null, null, url
);
19 log("Trying to pushState() with url " + url
+ " succeeded, but should've failed.");
21 log("Trying to pushState() with url " + url
+ " failed with exception " + e
);
23 log("History length is " + history
.length
);
26 history
.replaceState(null, null, url
);
27 log("Trying to replaceState() with url " + url
+ " succeeded, but should've failed.");
29 log("Trying to replaceState() with url " + url
+ " failed with exception " + e
);
31 log("History length is " + history
.length
);
34 var URLsToTry
= new Array(
35 "http://localhost/test.html",
36 "http://localhost:8001/test.html",
37 "http://www.webkit.org/test.html",
38 "http://www.webkit.org/",
39 "ftp://www.webkit.org/",
40 "file://anyfile.html/"
50 <body onload=
"runTest();">
52 This test makes sure that calls to pushState() and replaceState() with URLs that violate the security origin check fail as expected.
54 <pre id=
"logger"></pre>