Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(364)

Unified Diff: LayoutTests/http/tests/security/cross-frame-access-history-get-override.html

Issue 14198015: Deny cross-origin access to 'window.history'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/security/cross-frame-access-history-get-override.html
diff --git a/LayoutTests/http/tests/security/cross-frame-access-history-get-override.html b/LayoutTests/http/tests/security/cross-frame-access-history-get-override.html
deleted file mode 100644
index 74fd338bfd8025ef843146fd79f34bb0c2b5c9ea..0000000000000000000000000000000000000000
--- a/LayoutTests/http/tests/security/cross-frame-access-history-get-override.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<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" }
- shouldBeTrue("canGet('targetWindow.history.back')");
- shouldBe("toString('targetWindow.history.back')", "toString('window.history.back')");
-
- // Overriden using window.history.__proto__.forward = function() { return "new forward;" }
- shouldBeTrue("canGet('targetWindow.history.forward')");
- shouldBe("toString('targetWindow.history.forward')", "toString('window.history.forward')");
-
- // Overriden using window.history.go = "new go"
- shouldBeTrue("canGet('targetWindow.history.go')");
- shouldBe("toString('targetWindow.history.go')", "toString('window.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>

Powered by Google App Engine
This is Rietveld 408576698