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

Unified Diff: LayoutTests/fast/forms/range/range-keyboard-oninput-event.html

Issue 178593003: Dispatch input event for Range element keyboard event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed typo Created 6 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/forms/range/range-keyboard-oninput-event-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/forms/range/range-keyboard-oninput-event.html
diff --git a/LayoutTests/fast/forms/range/range-keyboard-oninput-event.html b/LayoutTests/fast/forms/range/range-keyboard-oninput-event.html
new file mode 100644
index 0000000000000000000000000000000000000000..e12d60dd45639205bc01c446c01e46b4ccd37c36
--- /dev/null
+++ b/LayoutTests/fast/forms/range/range-keyboard-oninput-event.html
@@ -0,0 +1,33 @@
+<html>
+ <head>
+ <script>
+
+ function sendKey(element, keyName) {
+ var event = document.createEvent('KeyboardEvent');
keishi 2014/03/03 06:51:11 I'm not sure if we will keep allow triggering of d
Habib Virji 2014/03/04 10:32:52 Done.
+ event.initKeyboardEvent('keydown', true, true, document.defaultView, keyName);
+ element.dispatchEvent(event);
+ }
+ function log(msg)
+ {
+ var res = document.getElementById('res');
+ res.innerHTML = res.innerHTML + msg + "<br>";
+ }
+ function test()
+ {
+ var slider = document.getElementById('slider');
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ // slider drag
+ sendKey(slider, 'Left');
+ sendKey(slider, 'Right');
+
+ }
+ }
+ </script>
+ </head>
+ <body onload="test()">
+ This tests that range generates oninput when in focus for keyboard event and when onblur or out of focus generates for keyboard events.
+ <input type="range" id="slider" oninput="log('input')" onchange="log('change')" min=0 max=100 value=50>
keishi 2014/03/03 06:51:11 I would prefer using js-test.js so we are clear wh
Habib Virji 2014/03/04 10:32:52 Done.
+ <div id="res"></div>
+ </body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/forms/range/range-keyboard-oninput-event-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698