Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / number / number-input-changeevent.html
blob1abe0523d709026b0e37f01f1727f07d5bac4eba
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p>This test ensures change event is fired for input[type=number] when the user reverts the change made by a script.</p>
5 <div id="console"></div>
6 <div><input id="test" type="number" onchange="numberOfChangeEventsFired++;"><input id="dummy"></div>
7 <script src="../../../resources/js-test.js"></script>
8 <script>
10 if (window.testRunner)
11 testRunner.dumpAsText();
13 var numberOfChangeEventsFired = 0;
14 var test = document.getElementById('test');
15 var dummy = document.getElementById('dummy');
16 test.focus();
18 if (window.eventSender) {
19 shouldBe("eventSender.keyDown('1');eventSender.keyDown('2');dummy.focus();numberOfChangeEventsFired", '1');
20 shouldBe("test.value = '34';numberOfChangeEventsFired", '1');
21 shouldBe("test.focus();test.value = '34';document.execCommand('SelectAll');\n"
22 + "eventSender.keyDown('1');eventSender.keyDown('2');dummy.focus();numberOfChangeEventsFired", '2');
23 test.parentNode.style.display = 'none';
26 </script>
27 </body>
28 </html>