Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / navigation / resources / submit-to-fragment.pl
blob0f5dea22a14515e76d32b13c757b34db95ca0d23
1 #!/usr/bin/perl -wT
3 use strict;
4 use CGI;
6 my $cgi = new CGI;
8 print "Content-Type: text/html\n";
9 print "\n";
11 print <<"END";
12 <form method="POST" enctype="application/x-www-form-urlencoded" action="#foo">
13 <input type="text" name="f">
14 <input type="submit" value="Submit">
15 </form>
16 <div id="result"></div>
17 <script>
18 onunload = function() {
19 // no page cache
21 onload = function() {
22 alert("stage: " + sessionStorage.stage);
23 switch (sessionStorage.stage++) {
24 case 1:
25 // Submit form in a timeout to make sure that we create a new back/forward list item.
26 setTimeout(function() {document.forms[0].submit();}, 0);
27 break;
28 case 2:
29 history.back();
30 break;
31 case 3:
32 document.getElementById("result").innerText = "PASS";
33 if (window.testRunner)
34 testRunner.notifyDone();
35 break;
38 </script>
39 END