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

Unified Diff: chrome/test/data/webui/md_bookmarks/command_manager_test.js

Issue 2939873004: MD Bookmarks: Fix issue where keyboard shortcuts could fire incorrectly (Closed)
Patch Set: Fix mac test? Created 3 years, 6 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
Index: chrome/test/data/webui/md_bookmarks/command_manager_test.js
diff --git a/chrome/test/data/webui/md_bookmarks/command_manager_test.js b/chrome/test/data/webui/md_bookmarks/command_manager_test.js
index 641c11d45f15d00f473fc61b88e6d13e430299bc..eb844b95d965ba26e534712ee4a8b6d8203ac54b 100644
--- a/chrome/test/data/webui/md_bookmarks/command_manager_test.js
+++ b/chrome/test/data/webui/md_bookmarks/command_manager_test.js
@@ -124,7 +124,7 @@ suite('<bookmarks-command-manager>', function() {
var undoModifier = cr.isMac ? 'meta' : 'ctrl';
var undoKey = 'z';
var redoModifier = cr.isMac ? ['meta', 'shift'] : 'ctrl'
- var redoKey = cr.isMac ? 'z' : 'y';
+ var redoKey = cr.isMac ? 'Z' : 'y';
MockInteractions.pressAndReleaseKeyOn(
document.body, '', undoModifier, undoKey);
@@ -171,6 +171,16 @@ suite('<bookmarks-command-manager>', function() {
assertFalse(lastCreate.incognito);
});
+ test('shift-enter does not trigger enter commands', function() {
+ // Enter by itself performs an edit (Mac) or open (non-Mac). Ensure that
+ // shift-enter doesn't trigger those commands.
+ store.data.selection.items = new Set(['13']);
+ store.notifyObservers();
+
+ MockInteractions.pressAndReleaseKeyOn(document.body, 13, 'shift', 'Enter');
+ commandManager.assertLastCommand(Command.OPEN_NEW_WINDOW);
+ });
+
test('cannot execute "Open in New Tab" on folders with no items', function() {
var items = new Set(['2']);
assertFalse(commandManager.canExecute(Command.OPEN_NEW_TAB, items));

Powered by Google App Engine
This is Rietveld 408576698