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

Unified Diff: chrome/test/data/webui/settings/focusable_iron_list_item_behavior_test.js

Issue 2745653003: MD Settings: fix unnecessary focus on list items. (Closed)
Patch Set: fixes based on comments Created 3 years, 9 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 | « chrome/browser/resources/settings/focusable_iron_list_item_behavior.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/settings/focusable_iron_list_item_behavior_test.js
diff --git a/chrome/test/data/webui/settings/focusable_iron_list_item_behavior_test.js b/chrome/test/data/webui/settings/focusable_iron_list_item_behavior_test.js
index ca95400ad68ec1867f9d0680f66c77fbfaf1a4a3..3decda4e417e9f697c75396851f404db52e19021 100644
--- a/chrome/test/data/webui/settings/focusable_iron_list_item_behavior_test.js
+++ b/chrome/test/data/webui/settings/focusable_iron_list_item_behavior_test.js
@@ -41,4 +41,22 @@ suite('focusable-iron-list-item-behavior', function() {
MockInteractions.tap(testElement);
assertTrue(testElement.classList.contains('no-outline'));
});
+
+ test('"enter" key event should not propagate out of element', function() {
+ var container = document.createElement('div');
+ container.appendChild(testElement);
+ document.body.appendChild(container);
+
+ var reached = false;
+ container.addEventListener('keydown', function() {
+ reached = true;
+ });
+
+ MockInteractions.keyEventOn(testElement, 'keydown', 13, undefined, 'Enter');
+ assertFalse(reached);
+
+ // Test other keys still work.
+ MockInteractions.keyEventOn(testElement, 'keydown', 9, undefined, 'Tab');
+ assertTrue(reached);
+ });
});
« no previous file with comments | « chrome/browser/resources/settings/focusable_iron_list_item_behavior.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698