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

Side by Side Diff: LayoutTests/fast/forms/state-restore-hidden.html

Issue 54473004: Make js-test-post a noop. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add mac NeedsRebaselines Created 7 years, 1 month 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../js/resources/js-test-pre.js"></script> 4 <script src="../js/resources/js-test-pre.js"></script>
5 </head> 5 </head>
6 <body onload="runTest()"> 6 <body onload="runTest()">
7 7
8 <div id="console"></div> 8 <div id="console"></div>
9 9
10 <input id="emptyOnFirstVisit" /> 10 <input id="emptyOnFirstVisit" />
11 <form action="data:text/html,<script>history.back()&lt;/script>" name=f> 11 <form action="data:text/html,<script>history.back()&lt;/script>" name=f>
12 <input type="hidden" name="hidden" value="before" /> 12 <input type="hidden" name="hidden" value="before" />
13 </form> 13 </form>
14 14
15 <script> 15 <script>
16 description("Bug 77391 - Hidden form elements do not save their state prior to f orm submission"); 16 description("Bug 77391 - Hidden form elements do not save their state prior to f orm submission");
17 17
18 window.jsTestIsAsync = true;
19
18 function runTest() { 20 function runTest() {
19 var state = document.getElementById("emptyOnFirstVisit"); 21 var state = document.getElementById("emptyOnFirstVisit");
20 if (!state.value) { 22 if (!state.value) {
21 // First visit. 23 // First visit.
22 if (window.testRunner) 24 if (window.testRunner)
23 testRunner.waitUntilDone(); 25 testRunner.waitUntilDone();
24 state.value = "visited"; 26 state.value = "visited";
25 27
26 document.f.hidden.value = "after"; 28 document.f.hidden.value = "after";
27 // Submit form in a timeout to make sure that we create a new back/forwa rd list item. 29 // Submit form in a timeout to make sure that we create a new back/forwa rd list item.
28 setTimeout(function() {document.f.submit();}, 0); 30 setTimeout(function() {document.f.submit();}, 0);
29 } else { 31 } else {
30 // Second visit. 32 // Second visit.
31 shouldBeEqualToString("document.f.hidden.value", "after"); 33 shouldBeEqualToString("document.f.hidden.value", "after");
32 successfullyParsed = true; 34 successfullyParsed = true;
33 35
34 var script = document.createElement('script'); 36 finishJSTest();
35 script.src = "../js/resources/js-test-post.js";
36 script.type = "text/javascript";
37 script.onload = function() {
38 if (window.testRunner)
39 testRunner.notifyDone();
40 };
41 document.body.appendChild(script);
42 } 37 }
43 } 38 }
44 </script> 39 </script>
45 </body> 40 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698