Chromium Code Reviews| Index: chrome/test/data/webui/cr_elements/cr_action_menu_test.js |
| diff --git a/chrome/test/data/webui/cr_elements/cr_action_menu_test.js b/chrome/test/data/webui/cr_elements/cr_action_menu_test.js |
| index 635bd09c53790da842d12813214dc175c48d99f5..f46375b83f27a3cf51cce85ec616ffc70b0e20e5 100644 |
| --- a/chrome/test/data/webui/cr_elements/cr_action_menu_test.js |
| +++ b/chrome/test/data/webui/cr_elements/cr_action_menu_test.js |
| @@ -127,4 +127,28 @@ suite('CrActionMenu', function() { |
| test('close on Escape', function() { |
| return testFocusAfterClosing('Escape'); |
| }); |
| + |
| + test('mouse movement focus options', function() { |
| + menu.showAt(document.querySelector('#dots')); |
| + |
| + // Moving mouse on option 1 should focus it |
| + assertNotEquals(items[0], menu.root.activeElement); |
| + MockInteractions.move(items[0], {x: 0, y: 0}, {x: 1, y: 1}); |
| + menu.flushDebouncer('cr-action-menu-mousemove'); |
|
Dan Beam
2017/04/05 03:29:21
can you replace this with Polymer.dom.flush() or j
scottchen
2017/04/05 20:56:31
Yeah, don't need this anymore after removing the d
|
| + assertEquals(items[0], menu.root.activeElement); |
| + |
| + // Moving mouse on the menu (not on option) should focus the menu |
| + MockInteractions.move(menu, {x: 0, y: 0}, {x: 1, y: 1}); |
| + menu.flushDebouncer('cr-action-menu-mousemove'); |
| + assertNotEquals(items[0], menu.root.activeElement); |
| + assertEquals(menu, document.activeElement); |
| + |
| + // Mouse movements should override keyboard focus |
| + down(); |
| + down(); |
| + assertEquals(items[1], menu.root.activeElement); |
| + MockInteractions.move(items[0], {x: 0, y: 0}, {x: 1, y: 1}); |
| + menu.flushDebouncer('cr-action-menu-mousemove'); |
| + assertEquals(items[0], menu.root.activeElement); |
| + }); |
| }); |