OLD | NEW |
1 <p>This tests for a crash when adding/removing content from a search field that
is inside an editable region.</p> | 1 <p>This tests for a crash when adding/removing content from a search field that
is inside an editable region.</p> |
2 | 2 |
3 <div contenteditable="true"><input id="search" type="search"></div> | 3 <div contenteditable="true"><input id="search" type="search"></div> |
4 <ul id="console"></ul> | 4 <ul id="console"></ul> |
5 | 5 |
6 <script> | 6 <script> |
7 function log(msg) | 7 function log(msg) |
8 { | 8 { |
9 li = document.createElement("li"); | 9 li = document.createElement("li"); |
10 li.appendChild(document.createTextNode(msg)); | 10 li.appendChild(document.createTextNode(msg)); |
11 document.getElementById("console").appendChild(li); | 11 document.getElementById("console").appendChild(li); |
12 } | 12 } |
13 | 13 |
14 if (window.testRunner) | 14 if (window.testRunner) |
15 window.testRunner.dumpAsText(); | 15 window.testRunner.dumpAsText(); |
16 | 16 |
17 var search = document.getElementById("search"); | 17 var search = document.getElementById("search"); |
18 search.setSelectionRange(0, 0); | 18 search.focus(); |
19 document.execCommand("InsertText", false, "x"); | 19 document.execCommand("InsertText", false, "x"); |
20 if (search.value != "x") | 20 if (search.value != "x") |
21 log("Failure: text wasn't added to the search field."); | 21 log("Failure: text wasn't added to the search field."); |
22 document.execCommand("Delete"); | 22 document.execCommand("Delete"); |
23 if (search.value == "") | 23 if (search.value == "") |
24 log("Success! Test successfully removed text from the search field."); | 24 log("Success! Test successfully removed text from the search field."); |
25 </script> | 25 </script> |
OLD | NEW |