Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / state-restore-to-non-autocomplete-form.html
blobc3e30cd58b7e70cc094cdcc874d5051ba9bd9ab3
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body onload="runTest()">
7 <p>Test to NOT restore form state to a form with autocomplete=off.</p>
8 <div id="console"></div>
10 <input id=emptyOnFirstVisit>
11 <div id=parent>
12 <form action="data:text/html,<script>history.back()&lt;/script>" id=form1 autocomplete=off>
13 <input name=user id=input1>
14 <textarea name=comment id=textarea1></textarea>
15 <select name=os id=select1><option>Mac<option>Windows<option>BSD</select>
16 </form>
17 <form action="data:text/html,<script>history.back()&lt;/script>" id=form2>
18 <input name=user id=input2>
19 <textarea name=comment id=textarea2></textarea>
20 <select name=os id=select2><option>Mac<option>Windows<option>BSD</select>
21 </form>
22 </div>
24 <script>
26 function runTest()
28 var parent = document.getElementById('parent');
29 var state = document.getElementById('emptyOnFirstVisit');
30 if (!state.value) {
31 // First visit.
32 if (window.testRunner)
33 testRunner.waitUntilDone();
34 state.value = 'visited';
36 document.getElementById('input1').value = 'value1';
37 document.getElementById('textarea1').value = 'nice';
38 document.getElementById('select1').value = 'Windows';
39 document.getElementById('input2').value = 'value2';
40 document.getElementById('textarea2').value = 'good';
41 document.getElementById('select2').value = 'BSD';
42 // Submit form in a timeout to make sure that we create a new back/forward list item.
43 setTimeout(function() {document.getElementById('form2').submit();}, 0);
44 } else {
45 // Second visit.
46 debug('Controls in the first form should have their default values:');
47 shouldBe('document.getElementById("input1").value', '""');
48 shouldBe('document.getElementById("textarea1").value', '""');
49 shouldBe('document.getElementById("select1").value', '"Mac"');
50 debug('Controls in the second form should have edited values:');
51 shouldBe('document.getElementById("input2").value', '"value2"');
52 shouldBe('document.getElementById("textarea2").value', '"good"');
53 shouldBe('document.getElementById("select2").value', '"BSD"');
54 if (window.testRunner)
55 testRunner.notifyDone();
58 </script>
59 </body>