Chromium Code Reviews| 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..a21c3165b3df59af7c79ce04e319dccdd244ac69 |
| --- /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.alreadyRenamedSubframeAndTrigerredNavigations) |
|
dcheng
2016/09/09 22:00:13
Nit:triggered
Łukasz Anforowicz
2016/09/09 22:49:11
Done.
|
| + return; |
| + sessionStorage.alreadyRenamedSubframeAndTrigerredNavigations = 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> |