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

Unified Diff: LayoutTests/http/tests/history/back-to-post.html

Issue 22982011: Reland "Fix form resubmissions happening silently." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/http/tests/history/back-to-post.php » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/history/back-to-post.html
diff --git a/LayoutTests/http/tests/history/back-to-post.html b/LayoutTests/http/tests/history/back-to-post.html
new file mode 100644
index 0000000000000000000000000000000000000000..883a42a3c1e13aae3b4292df6f6be8f7ab706706
--- /dev/null
+++ b/LayoutTests/http/tests/history/back-to-post.html
@@ -0,0 +1,44 @@
+<html>
+<body>
+<p>Test for <a href="rdar://problem/6791439">rdar://problem/6791439</a>
+Getting an error page instead of login page navigating back in gmail.</p>
+<div id="result">FAIL: Script did not run</div>
+
+<form action="back-to-post.html" method="post">
+<input name="a" value="b">
+<input id="mysubmit" type="submit" name="Submit" value="Submit">
+</form>
+<script>
+
+function submitForm()
+{
+ // Submit form in a timeout to make sure that we create a new back/forward list item.
+ setTimeout(function() {document.forms[0].submit()}, 0);
+}
+
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ testRunner.setCustomPolicyDelegate(true, true);
+}
+
+var step = localStorage.getItem("back-to-post");
+if (step == null) {
+ localStorage.setItem("back-to-post", "1");
+ submitForm();
+} else if (step == "1") {
+ localStorage.setItem("back-to-post", "2");
+ submitForm();
+} else if (step == "2") {
+ // Test that going back to form submission result works.
+ localStorage.setItem("back-to-post", "3");
+ history.back();
+} else if (step == "3") {
+ localStorage.removeItem("back-to-post");
+ document.getElementById("result").innerHTML = 'PASS';
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+</script>
+</body>
+</html>
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/http/tests/history/back-to-post.php » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698