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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/navigation/rename-subframe-goback.html

Issue 2317203002: Avoid mutating frame unique name after first real commit. (Closed)
Patch Set: Tweaking the comment describing the format of unique name. Created 4 years, 3 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: third_party/WebKit/LayoutTests/http/tests/navigation/rename-subframe-goback.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigation/rename-subframe-goback.html b/third_party/WebKit/LayoutTests/http/tests/navigation/rename-subframe-goback.html
new file mode 100644
index 0000000000000000000000000000000000000000..0c3294b52317af912e7d00d4f5828b1e6411e9d6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/navigation/rename-subframe-goback.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.dumpChildFramesAsText();
+ testRunner.waitUntilDone();
+ testRunner.clearBackForwardList();
+ }
+
+ function renameSubframeAndTriggerNavigations() {
+ setTimeout(function() {
+ // Make sure the child navigation only happens once.
+ if (sessionStorage.alreadyRenamedSubframeAndTriggeredNavigations)
+ return;
+ sessionStorage.alreadyRenamedSubframeAndTriggeredNavigations = true;
+
+ // Rename the child window. Without this step,
+ // https://crbug.com/607205 wouldn't repro.
+ var childWindow = document.getElementById("child").contentWindow;
+ childWindow.name = "changed-name";
+
+ // Navigate the child window and tell resources/form-target.pl
+ // what it should do after a load.
+ sessionStorage.formTargetShouldNavAndGoBack = true;
+ childWindow.location = "resources/page-that-posts.html";
+ }, 0);
+ }
+ </script>
+</head>
+<body onload="renameSubframeAndTriggerNavigations();">
+<p>Tests that session history works even if the page changes frame names after initial load.</p>
+<br>
+<iframe id="child" name="initial-name" src="resources/otherpage.html"></iframe>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698