| 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 d103eafa7ca76082ba8f01812bf5b21491f676fe..99a0e73fce83f203e80b1e608db5b56e74d14ba3 100644
|
| --- a/chrome/test/data/webui/md_bookmarks/command_manager_test.js
|
| +++ b/chrome/test/data/webui/md_bookmarks/command_manager_test.js
|
| @@ -185,6 +185,33 @@ suite('<bookmarks-command-manager>', function() {
|
| assertTrue(commandItem[Command.OPEN_INCOGNITO].disabled);
|
| assertFalse(commandItem[Command.OPEN_INCOGNITO].hidden);
|
| });
|
| +
|
| + test('ignores key events from outside the keyTarget', function() {
|
| + store.data.selection.items = new Set(['12']);
|
| + store.notifyObservers();
|
| +
|
| + var section1 = document.createElement('section');
|
| + var subsection = document.createElement('div');
|
| + var section2 = document.createElement('section');
|
| +
|
| + section1.appendChild(subsection);
|
| + document.body.appendChild(section1);
|
| + document.body.appendChild(section2);
|
| +
|
| + commandManager.keyTarget = section1;
|
| +
|
| + // Shortcuts are allowed from within the keyTarget.
|
| + MockInteractions.pressAndReleaseKeyOn(subsection, 13, 'shift', 'Enter');
|
| + assertLastCommand(Command.OPEN_NEW_WINDOW);
|
| +
|
| + // Shortcuts are not allowed from outside the keyTarget.
|
| + MockInteractions.pressAndReleaseKeyOn(section2, 13, 'shift', 'Enter');
|
| + assertLastCommand(null);
|
| +
|
| + // Shortcuts are always allowed on <body>.
|
| + MockInteractions.pressAndReleaseKeyOn(document.body, 13, 'shift', 'Enter');
|
| + assertLastCommand(Command.OPEN_NEW_WINDOW);
|
| + });
|
| });
|
|
|
| suite('<bookmarks-item> CommandManager integration', function() {
|
|
|