Use testRunner instead of layoutTestController in fast/doctypes, dom, dynamic, encodi...
[WebKit-https.git] / LayoutTests / fast / events / onchange-searchfield.html
1 <p>This test verifies that the ENTER key fires the change event.</p>
2 <hr>
3 <input id="input" type="search" onchange="changeHandler()" onblur="blurHandler()"></input>
4 <pre id="console"></pre>
5
6 <script>
7 function log(s)
8 {
9     document.getElementById('console').appendChild(document.createTextNode(s + "\n"));
10 }
11
12 function changeHandler()
13 {
14     log ('PASS: change event fired.\n');
15 }
16
17 function blurHandler()
18 {
19     log ('blur event fired.\n');
20 }
21
22 if (window.testRunner)
23     testRunner.dumpAsText();
24
25 // change the field
26 document.getElementById('input').focus();
27 document.execCommand("InsertText", false, "foo bar baz");
28
29 // hit enter
30 input.focus();
31 if (window.eventSender)
32     eventSender.keyDown("\r", []);
33
34 </script>