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

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/select/ignore-keydown-with-modifiers.html

Issue 2511923002: <select>: ignore modified keydown events in some cases (Closed)
Patch Set: tests Created 4 years, 1 month 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 | third_party/WebKit/Source/core/html/HTMLSelectElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/forms/select/ignore-keydown-with-modifiers.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/select/ignore-keydown-with-modifiers.html b/third_party/WebKit/LayoutTests/fast/forms/select/ignore-keydown-with-modifiers.html
new file mode 100644
index 0000000000000000000000000000000000000000..c6f28c2f14376567b6ce81b4ff979e7f05cd7532
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/forms/select/ignore-keydown-with-modifiers.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<body>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<div id="log"></div>
+
+<select autofocus>
+<option selected>a</option>
+<option>b</option>
+<option>c</option>
+</select>
+
+<script>
+
+test(function() {
+ var select = document.querySelector('select');
+ assert_not_equals(null, select);
+
+ select.focus();
+ assert_equals(select, document.activeElement, 'has focus');
+
+ assert_equals(select.selectedIndex, 0, 'starts at 0');
+
+ eventSender.keyDown('ArrowRight', ['shiftKey']);
+ assert_equals(select.selectedIndex, 0, 'shift+right is ignored');
+
+ eventSender.keyDown('ArrowRight', ['ctrlKey']);
+ assert_equals(select.selectedIndex, 0, 'ctrl+right is ignored');
+
+ eventSender.keyDown('ArrowRight', ['altKey']);
+ assert_equals(select.selectedIndex, 0, 'alt+right is ignored');
+
+ eventSender.keyDown('ArrowRight', ['metaKey']);
+ assert_equals(select.selectedIndex, 0, 'meta+right is ignored');
+}, 'Tests that arrow keys with modifiers are ignored');
+
+</script>
+</body>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLSelectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698