OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <p>Test to NOT save state for non-edited controls</p> | 7 <p>Test to NOT save state for non-edited controls</p> |
8 <div id="console"></div> | 8 <div id="console"></div> |
9 | 9 |
10 <input id=emptyOnFirstVisit> | 10 <input id=emptyOnFirstVisit> |
(...skipping 22 matching lines...) Expand all Loading... |
33 var state = document.getElementById('emptyOnFirstVisit'); | 33 var state = document.getElementById('emptyOnFirstVisit'); |
34 if (!state.value) { | 34 if (!state.value) { |
35 // First visit. | 35 // First visit. |
36 if (window.testRunner) | 36 if (window.testRunner) |
37 testRunner.waitUntilDone(); | 37 testRunner.waitUntilDone(); |
38 state.value = 'visited'; | 38 state.value = 'visited'; |
39 makeForm(parent, '1', '1', '1', '1', '1', '1', '1', '1', '1'); | 39 makeForm(parent, '1', '1', '1', '1', '1', '1', '1', '1', '1'); |
40 | 40 |
41 document.getElementById('text1').value = 'edit'; | 41 document.getElementById('text1').value = 'edit'; |
42 // Submit form in a timeout to make sure that we create a new back/forwa
rd list item. | 42 // Submit form in a timeout to make sure that we create a new back/forwa
rd list item. |
43 setTimeout(function() {document.getElementById('form1').submit();}, 0); | 43 setTimeout(function() {document.getElementById('form1').submit();}, 100)
; |
44 } else { | 44 } else { |
45 // Second visit. | 45 // Second visit. |
46 makeForm(parent, '2', '2', '2', '2', '2', '2', '2', '2', '2'); | 46 makeForm(parent, '2', '2', '2', '2', '2', '2', '2', '2', '2'); |
47 | 47 |
48 shouldBe('document.getElementById("button").value', '"2"'); | 48 shouldBe('document.getElementById("button").value', '"2"'); |
49 shouldBe('document.getElementById("hidden").value', '"2"'); | 49 shouldBe('document.getElementById("hidden").value', '"2"'); |
50 shouldBe('document.getElementById("image").value', '"2"'); | 50 shouldBe('document.getElementById("image").value', '"2"'); |
51 shouldBe('document.getElementById("reset").value', '"2"'); | 51 shouldBe('document.getElementById("reset").value', '"2"'); |
52 shouldBe('document.getElementById("submit1").value', '"2"'); | 52 shouldBe('document.getElementById("submit1").value', '"2"'); |
53 shouldBe('document.getElementById("text0").value', '"2"'); | 53 shouldBe('document.getElementById("text0").value', '"2"'); |
54 shouldBe('document.getElementById("text1").value', '"edit"'); | 54 shouldBe('document.getElementById("text1").value', '"edit"'); |
55 shouldBe('document.getElementById("text2").value', '"2"'); | 55 shouldBe('document.getElementById("text2").value', '"2"'); |
56 shouldBe('document.getElementById("textarea").value', '"2"'); | 56 shouldBe('document.getElementById("textarea").value', '"2"'); |
57 | 57 |
58 parent.innerHTML = ''; | 58 parent.innerHTML = ''; |
59 if (window.testRunner) | 59 if (window.testRunner) |
60 testRunner.notifyDone(); | 60 testRunner.notifyDone(); |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 runTest(); | 64 runTest(); |
65 </script> | 65 </script> |
66 </body> | 66 </body> |
OLD | NEW |