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

Unified Diff: LayoutTests/fast/forms/select/listbox-tap-input-change-event.html

Issue 486583002: Regression: r170111 Tapping listbox items should fire change/input event (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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/select/listbox-tap-input-change-event-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/forms/select/listbox-tap-input-change-event.html
diff --git a/LayoutTests/fast/forms/select/listbox-tap-input-change-event.html b/LayoutTests/fast/forms/select/listbox-tap-input-change-event.html
new file mode 100644
index 0000000000000000000000000000000000000000..fe9bfe901e627cdf4f3e69964e5fd90360f60745
--- /dev/null
+++ b/LayoutTests/fast/forms/select/listbox-tap-input-change-event.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../../resources/js-test.js"></script>
+<select id="select1" multiple size="4">
+<option>1</option>
+<option>2</option>
+<option>3</option>
+</select>
+
+<script>
+description('Tapping on listbox items should fire an input and a change event.');
+
+function tapOption(select, index) {
+ var itemHeight = Math.floor(select.offsetHeight / select.size);
+ var border = 1;
+ var y = border + index * itemHeight;
+
+ select.focus();
+ if (window.eventSender) {
+ eventSender.gestureTap(select.offsetLeft + border, select.offsetTop + y - window.pageYOffset + itemHeight / 2);
+ }
+}
+
+var select = document.getElementById('select1');
+var changeEventCounter = 0;
+var inputEventCounter = 0;
+
+select.addEventListener('change', function () {
+ changeEventCounter++;
+}, false);
+
+select.addEventListener('input', function () {
+ inputEventCounter++;
+}, false);
+
+if (window.eventSender) {
+ shouldBe('changeEventCounter', '0');
+ shouldBe('inputEventCounter', '0');
+ tapOption(select, 0);
+ shouldBe('changeEventCounter', '1');
+ shouldBe('inputEventCounter', '1');
+}
+</script>
+
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/forms/select/listbox-tap-input-change-event-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698