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

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

Issue 2885353002: MD Bookmarks: Prevent keyboard shortcuts when the toolbar/dialogs are focused (Closed)
Patch Set: Add a 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 a862fbd33df4ada5562e57bc40ffb99fad55bae6..e31ea43d29312d90dd5ab9d68fa019f4ba53901e 100644
--- a/chrome/test/data/webui/md_bookmarks/command_manager_test.js
+++ b/chrome/test/data/webui/md_bookmarks/command_manager_test.js
@@ -76,21 +76,21 @@ suite('<bookmarks-command-manager>', function() {
store.data.selection.items = new Set(['13']);
store.notifyObservers();
- MockInteractions.pressAndReleaseKeyOn(document, 67, modifier, 'c');
+ MockInteractions.pressAndReleaseKeyOn(document.body, 67, modifier, 'c');
commandManager.assertLastCommand('copy', ['13']);
// Doesn't trigger when a folder is selected.
store.data.selection.items = new Set(['11']);
store.notifyObservers();
- MockInteractions.pressAndReleaseKeyOn(document, 67, modifier, 'c');
+ MockInteractions.pressAndReleaseKeyOn(document.body, 67, modifier, 'c');
commandManager.assertLastCommand(null);
// Doesn't trigger when nothing is selected.
store.data.selection.items = new Set();
store.notifyObservers();
- MockInteractions.pressAndReleaseKeyOn(document, 67, modifier, 'c');
+ MockInteractions.pressAndReleaseKeyOn(document.body, 67, modifier, 'c');
commandManager.assertLastCommand(null);
});
@@ -98,7 +98,7 @@ suite('<bookmarks-command-manager>', function() {
store.data.selection.items = new Set(['12', '13']);
store.notifyObservers();
- MockInteractions.pressAndReleaseKeyOn(document, 46, '', 'Delete');
+ MockInteractions.pressAndReleaseKeyOn(document.body, 46, '', 'Delete');
commandManager.assertLastCommand('delete', ['12', '13']);
});
@@ -109,7 +109,7 @@ suite('<bookmarks-command-manager>', function() {
store.data.selection.items = new Set(['11']);
store.notifyObservers();
- MockInteractions.pressAndReleaseKeyOn(document, keyCode, '', key);
+ MockInteractions.pressAndReleaseKeyOn(document.body, keyCode, '', key);
commandManager.assertLastCommand('edit', ['11']);
});
@@ -119,10 +119,12 @@ suite('<bookmarks-command-manager>', function() {
var redoModifier = cr.isMac ? ['meta', 'shift'] : 'ctrl'
var redoKey = cr.isMac ? 'z' : 'y';
- MockInteractions.pressAndReleaseKeyOn(document, '', undoModifier, undoKey);
+ MockInteractions.pressAndReleaseKeyOn(
+ document.body, '', undoModifier, undoKey);
commandManager.assertLastCommand('undo');
- MockInteractions.pressAndReleaseKeyOn(document, '', redoModifier, redoKey);
+ MockInteractions.pressAndReleaseKeyOn(
+ document.body, '', redoModifier, redoKey);
commandManager.assertLastCommand('redo');
});
@@ -156,7 +158,7 @@ suite('<bookmarks-command-manager>', function() {
lastCreate = createConfig;
};
- MockInteractions.pressAndReleaseKeyOn(document, 13, 'shift', 'Enter');
+ MockInteractions.pressAndReleaseKeyOn(document.body, 13, 'shift', 'Enter');
commandManager.assertLastCommand(Command.OPEN_NEW_WINDOW, ['12', '13']);
assertDeepEquals(['http://121/', 'http://13/'], lastCreate.url);
assertFalse(lastCreate.incognito);
« no previous file with comments | « chrome/browser/resources/md_bookmarks/list.js ('k') | chrome/test/data/webui/md_bookmarks/md_bookmarks_focus_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698