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

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

Issue 2801453002: MD Settings: mouse movements should focus cr-action-menu items (Closed)
Patch Set: add missing import Created 3 years, 8 months 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 | ui/webui/resources/cr_elements/cr_action_menu/compiled_resources2.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d36f8e9c47b9e936c56bd78e9109ae95af8b265d 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,30 @@ suite('CrActionMenu', function() {
test('close on Escape', function() {
return testFocusAfterClosing('Escape');
});
+
+ test('mouse movement focus options', function() {
+ function makeMouseoverEvent(node) {
+ var e = new MouseEvent('mouseover', {bubbles: true});
+ node.dispatchEvent(e);
+ }
+
+ menu.showAt(document.querySelector('#dots'));
+
+ // Moving mouse on option 1 should focus it.
+ assertNotEquals(items[0], menu.root.activeElement);
+ makeMouseoverEvent(items[0]);
+ assertEquals(items[0], menu.root.activeElement);
+
+ // Moving mouse on the menu (not on option) should focus the menu.
+ makeMouseoverEvent(menu);
+ assertNotEquals(items[0], menu.root.activeElement);
+ assertEquals(menu, document.activeElement);
+
+ // Mouse movements should override keyboard focus.
+ down();
+ down();
+ assertEquals(items[1], menu.root.activeElement);
+ makeMouseoverEvent(items[0]);
+ assertEquals(items[0], menu.root.activeElement);
+ });
});
« no previous file with comments | « no previous file | ui/webui/resources/cr_elements/cr_action_menu/compiled_resources2.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698