Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / button-state-restore.html
blobcc75ab666561cb349da9cff1f2cf3bc9d332981c
1 <html>
2 <head>
3 <script>
4 function loaded()
6 var beenHere = document.getElementById("beenHere");
7 var input = document.getElementById("input");
9 if (beenHere.value) {
10 var result = "FAIL";
11 // Button value is not restored.
12 if (input.value == "PASS") {
13 beenHere.value = "PASS";
14 result = "PASS";
17 document.getElementById("result").innerText = result;
19 if (window.testRunner)
20 testRunner.notifyDone();
21 return;
24 if (window.testRunner) {
25 testRunner.dumpAsText();
26 testRunner.waitUntilDone();
29 beenHere.value = "FAIL";
31 input.value = "FAIL";
33 var form = document.getElementById("form");
35 // Submit form in a timeout to make sure that we create a new back/forward list item.
36 setTimeout(function() {form.submit();}, 0);
38 </script>
39 </head>
40 <!-- the unload handler keeps this page out of the B/F cache -->
41 <body onunload="" onload="loaded()">
42 <p>
43 This is a test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=14400">http://bugs.webkit.org/show_bug.cgi?id=14400</a>
44 Assertion failure (SHOULD NEVER BE REACHED) going back on YouTube</i>.
45 </p>
46 <p>
47 Test result: <span id="result">test did not complete</span>
48 </p>
49 <button type="button" name="foo">Button</button>
50 <input id="input" type="button" name="foo" value="PASS">
51 <input id="beenHere">
52 <form action="data:text/html,<script>history.back()</script>" method="POST" id="form"></form>
53 </body>
54 </html>