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

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, take 2 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..0faf4097491872702b0c741a295653c3c0d5c67b 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);
+
+ selector.ignoreModifiedKeyEvents = true;
Moe 2016/12/20 19:07:40 maybe set the property on avatarSelector to test t
Dan Beam 2016/12/20 19:31:15 Done.
+
+ 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