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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/select/select-reset.html

Issue 1509853008: Move select/option/optgroup-related tests in fast/forms to fast/forms/select. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
OLDNEW
1 <head> 1 <head>
2 <script> 2 <script>
3 function test() 3 function test()
4 { 4 {
5 if (window.testRunner) 5 if (window.testRunner)
6 testRunner.dumpAsText(); 6 testRunner.dumpAsText();
7 var select = document.getElementById('select'); 7 var select = document.getElementById('select');
8 var index = select.selectedIndex; 8 var index = select.selectedIndex;
9 document.forms[0].reset(); 9 document.forms[0].reset();
10 var message = "selected index is " + index + " before and " + select.selecte dIndex + " after reset()."; 10 var message = "selected index is " + index + " before and " + select.selecte dIndex + " after reset().";
11 var paragraph = document.createElement('p'); 11 var paragraph = document.createElement('p');
12 paragraph.appendChild(document.createTextNode(message)); 12 paragraph.appendChild(document.createTextNode(message));
13 document.getElementById('console').appendChild(paragraph); 13 document.getElementById('console').appendChild(paragraph);
14 } 14 }
15 </script> 15 </script>
16 </head> 16 </head>
17 <body onload="test();"> 17 <body onload="test();">
18 <p>This tests reseting of a select box with no selected options using JavaScript . If successful, both times the selected index should be 0.<form> 18 <p>This tests reseting of a select box with no selected options using JavaScript . If successful, both times the selected index should be 0.<form>
19 <form> 19 <form>
20 <select id="select"> 20 <select id="select">
21 <option>Option 0</option> 21 <option>Option 0</option>
22 <option>Option 1</option> 22 <option>Option 1</option>
23 <option>Option 2</option> 23 <option>Option 2</option>
24 </select> 24 </select>
25 </form> 25 </form>
26 <p id="console"></p> 26 <p id="console"></p>
27 </body> 27 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698