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

Unified Diff: chrome/test/data/webui/cr_elements/cr_profile_avatar_selector_tests.js

Issue 2586113002: MD Settings: ignore modified key events in the profile avatar grid (Closed)
Patch Set: closure Created 4 years 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
Index: chrome/test/data/webui/cr_elements/cr_profile_avatar_selector_tests.js
diff --git a/chrome/test/data/webui/cr_elements/cr_profile_avatar_selector_tests.js b/chrome/test/data/webui/cr_elements/cr_profile_avatar_selector_tests.js
index d42299705cad1a354ede205ab1e852887230ef85..f76661373d2a0a38281848bf438e6956ef247738 100644
--- a/chrome/test/data/webui/cr_elements/cr_profile_avatar_selector_tests.js
+++ b/chrome/test/data/webui/cr_elements/cr_profile_avatar_selector_tests.js
@@ -88,6 +88,34 @@ cr.define('cr_profile_avatar_selector', function() {
// Simulate tapping the second avatar.
MockInteractions.tap(avatarSelector.$['avatar-grid'].items[1]);
});
+
+ test('Ignores modified key events', function() {
+ var selector = avatarSelector.$['avatar-grid'];
+ var items = selector.items;
+
+ selector._setFocusedItem(items[0]);
+ assertTrue(items[0].focused);
+
+ MockInteractions.keyDownOn(items[0], 39, [], 'ArrowRight');
+ assertTrue(items[1].focused);
+
+ MockInteractions.keyDownOn(items[0], 37, [], 'ArrowLeft');
+ assertTrue(items[0].focused);
+
+ avatarSelector.ignoreModifiedKeyEvents = true;
+
+ MockInteractions.keyDownOn(items[0], 39, 'alt', 'ArrowRight');
+ assertTrue(items[0].focused);
+
+ MockInteractions.keyDownOn(items[0], 39, 'ctrl', 'ArrowRight');
+ assertTrue(items[0].focused);
+
+ MockInteractions.keyDownOn(items[0], 39, 'meta', 'ArrowRight');
+ assertTrue(items[0].focused);
+
+ MockInteractions.keyDownOn(items[0], 39, 'shift', 'ArrowRight');
+ assertTrue(items[0].focused);
+ });
});
}

Powered by Google App Engine
This is Rietveld 408576698