| <html> |
| <head> |
| <script src="resources/cross-frame-access.js"></script> |
| <script> |
| window.onload = function() |
| { |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| testRunner.waitUntilDone(); |
| } |
| |
| if (window.testRunner) { |
| setTimeout(pollForTest, 1); |
| } else { |
| log("To run the test, click the button below when the opened window finishes loading."); |
| var button = document.createElement("button"); |
| button.appendChild(document.createTextNode("Run Test")); |
| button.onclick = runTest; |
| document.body.appendChild(button); |
| } |
| } |
| |
| pollForTest = function() |
| { |
| if (!testRunner.globalFlag) { |
| setTimeout(pollForTest, 1); |
| return; |
| } |
| runTest(); |
| testRunner.notifyDone(); |
| } |
| |
| runTest = function() |
| { |
| window.targetWindow = frames[0]; |
| |
| log("----- tests for getting a targetWindow's history object's functions which have custom overrides. The" + |
| " desired behavior is for the targetWindow to return the builtin function, not the override -----\n"); |
| |
| // Overriden using window.history.back = function() { return "new back" } |
| shouldBeFalse("canGet('targetWindow.history.back')"); |
| |
| // Overriden using window.history.__proto__.forward = function() { return "new forward;" } |
| shouldBeFalse("canGet('targetWindow.history.forward')"); |
| |
| // Overriden using window.history.go = "new go" |
| shouldBeFalse("canGet('targetWindow.history.go')"); |
| } |
| </script> |
| </head> |
| <body> |
| <iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for-history-get-override-test.html"></iframe> |
| <pre id="console"></pre> |
| </body> |
| </html> |