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

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: Updated test to use event.type and corrected format 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..a6a48ab77c64e52c45aa679272b9bbcf75985661
--- /dev/null
+++ b/LayoutTests/fast/forms/range/range-keyboard-oninput-event.html
@@ -0,0 +1,41 @@
+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+</head>
+<body>
+<input type="range" id="slider" oninput="log(event)" onchange="log(event)" min=0 max=100 value=50>
+<script>
+ description('Test that for each keyboard event both input and change event are dispatched');
tkent 2014/03/04 22:24:28 nit: You don't need to indent the whole content of
+ var changeEventCounter = 0;
+ var lastChangeEventCounter = changeEventCounter;
+ var inputEventCounter = 0;
+ var lastInputEventCounter = inputEventCounter;
+
+ function log(event) {
+ if (event.type == 'input')
+ inputEventCounter++;
+ if (event.type == 'change')
+ changeEventCounter++;
+ }
+
+ function testInput() {
+ var slider = document.getElementById('slider');
+ if (window.testRunner) {
+ // slider drag
+ slider.focus();
+ debug('Move left');
+ eventSender.keyDown('leftArrow');
+ shouldBeGreaterThanOrEqual('inputEventCounter' , 'lastInputEventCounter + 1');
+ shouldBeGreaterThanOrEqual('changeEventCounter', 'lastChangeEventCounter + 1');
+ debug('Move right');
+ lastInputEventCounter = inputEventCounter;
+ lastChangeEventCounter = changeEventCounter;
+ eventSender.keyDown('rightArrow');
+ shouldBeGreaterThanOrEqual('inputEventCounter' , 'lastInputEventCounter + 1');
+ shouldBeGreaterThanOrEqual('changeEventCounter', 'lastChangeEventCounter + 1');
+ }
+ }
+ testInput();
+</script>
+</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