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

Side by Side Diff: LayoutTests/http/tests/history/back-to-post.php

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <?php
2 header("Cache-control: no-cache, no-store");
3 header("Pragma: no-cache");
4 ?>
5
6 <html>
7 <body>
8 <p>Test for <a href="rdar://problem/6791439">rdar://problem/6791439</a>
9 Getting an error page instead of login page navigating back in gmail.</p>
10 <div id="result">FAIL: Script did not run</div>
11
12 <form action="back-to-post.php?1" method="post">
13 <input name="a" value="b">
14 <input id="mysubmit" type="submit" name="Submit" value="Submit">
15 </form>
16 <script>
17
18 function submitForm()
19 {
20 // Submit form in a timeout to make sure that we create a new back/forward l ist item.
21 setTimeout(function() {document.forms[0].submit()}, 0);
22 }
23
24 if (window.testRunner) {
25 testRunner.dumpAsText();
26 testRunner.waitUntilDone();
27 }
28
29 // Disable b/f cache (not necessary in DRT since the b/f cache is disabled by de fault).
30 if (!window.testRunner)
31 window.onunload = function() {}
32
33 if (document.location.search == "") {
34 window.name = ""; // Use window.name to communicate between steps.
35 submitForm();
36 } else if (document.location.search == "?1") {
37 if (window.name == "finish") {
38 window.name = "";
39 document.getElementById("result").innerHTML = 'PASS';
40 if (window.testRunner)
41 testRunner.notifyDone();
42 } else {
43 document.forms[0].action = "?2";
44 submitForm();
45 }
46 } else {
47 // Test that going back to form submission result works.
48 window.name = "finish";
49 history.back();
50 }
51 </script>
52 </body>
53 </html>
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/history/back-to-post.html ('k') | LayoutTests/http/tests/history/back-to-post-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698