Chromium Code Reviews| 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); |
| + }); |
| }); |
| } |