| Index: chrome/test/data/webui/md_bookmarks/md_bookmarks_focus_test.js
|
| diff --git a/chrome/test/data/webui/md_bookmarks/md_bookmarks_focus_test.js b/chrome/test/data/webui/md_bookmarks/md_bookmarks_focus_test.js
|
| index 27072b0c9b5056dbf9a4f137ebe821dc13d36eb4..919894d6610971dd4181f087393f9304265bbd67 100644
|
| --- a/chrome/test/data/webui/md_bookmarks/md_bookmarks_focus_test.js
|
| +++ b/chrome/test/data/webui/md_bookmarks/md_bookmarks_focus_test.js
|
| @@ -24,6 +24,7 @@ MaterialBookmarksFocusTest.prototype = {
|
| [{switchName: 'enable-features', switchValue: 'MaterialDesignBookmarks'}],
|
|
|
| extraLibraries: PolymerTest.getLibraries(ROOT_PATH).concat([
|
| + 'test_command_manager.js',
|
| 'test_store.js',
|
| 'test_util.js',
|
| ]),
|
| @@ -178,6 +179,20 @@ TEST_F('MaterialBookmarksFocusTest', 'All', function() {
|
|
|
| document.body.style.direction = 'ltr';
|
| });
|
| +
|
| + test('keyboard commands are passed to command manager', function() {
|
| + var commandManager = new TestCommandManager();
|
| + document.body.appendChild(commandManager);
|
| + chrome.bookmarkManagerPrivate.removeTrees = function() {}
|
| +
|
| + store.data.selection.items = new Set(['3', '4']);
|
| + store.notifyObservers();
|
| +
|
| + getFolderNode('1').$.container.focus();
|
| + keydown('1', 'delete');
|
| +
|
| + commandManager.assertLastCommand(Command.DELETE, ['1']);
|
| + });
|
| });
|
|
|
| suite('<bookmarks-list>', function() {
|
| @@ -344,6 +359,23 @@ TEST_F('MaterialBookmarksFocusTest', 'All', function() {
|
| assertDeepEquals(
|
| ['2', '4', '5', '6'], normalizeSet(store.data.selection.items));
|
| });
|
| +
|
| + test('keyboard commands are passed to command manager', function() {
|
| + var commandManager = new TestCommandManager();
|
| + document.body.appendChild(commandManager);
|
| + chrome.bookmarkManagerPrivate.removeTrees = function() {}
|
| +
|
| + store.data.selection.items = new Set(['2', '3']);
|
| + store.notifyObservers();
|
| +
|
| + var focusedItem = items[4];
|
| + focusedItem.focus();
|
| +
|
| + keydown(focusedItem, 'delete');
|
| + // Commands should take affect on the selection, even if something else is
|
| + // focused.
|
| + commandManager.assertLastCommand(Command.DELETE, ['2', '3']);
|
| + });
|
| });
|
|
|
| mocha.run();
|
|
|