| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Tests for MD Bookmarks which are run as interactive ui tests. | 6 * @fileoverview Tests for MD Bookmarks which are run as interactive ui tests. |
| 7 * Should be used for tests which care about focus. | 7 * Should be used for tests which care about focus. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 var ROOT_PATH = '../../../../../'; | 10 var ROOT_PATH = '../../../../../'; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 keydown('2', 'ArrowRight'); | 178 keydown('2', 'ArrowRight'); |
| 179 assertDeepEquals( | 179 assertDeepEquals( |
| 180 bookmarks.actions.changeFolderOpen('2', false), store.lastAction); | 180 bookmarks.actions.changeFolderOpen('2', false), store.lastAction); |
| 181 | 181 |
| 182 document.body.style.direction = 'ltr'; | 182 document.body.style.direction = 'ltr'; |
| 183 }); | 183 }); |
| 184 | 184 |
| 185 test('keyboard commands are passed to command manager', function() { | 185 test('keyboard commands are passed to command manager', function() { |
| 186 var commandManager = new TestCommandManager(); | 186 var commandManager = new TestCommandManager(); |
| 187 document.body.appendChild(commandManager); | 187 document.body.appendChild(commandManager); |
| 188 chrome.bookmarkManagerPrivate.removeTrees = function() {} | 188 chrome.bookmarkManagerPrivate.removeTrees = function() {}; |
| 189 | 189 |
| 190 store.data.selection.items = new Set(['3', '4']); | 190 store.data.selection.items = new Set(['3', '4']); |
| 191 store.data.selectedFolder = '2'; | 191 store.data.selectedFolder = '2'; |
| 192 store.notifyObservers(); | 192 store.notifyObservers(); |
| 193 | 193 |
| 194 getFolderNode('2').$.container.focus(); | 194 getFolderNode('2').$.container.focus(); |
| 195 keydown('2', 'delete'); | 195 keydown('2', 'Delete'); |
| 196 | 196 |
| 197 commandManager.assertLastCommand(Command.DELETE, ['2']); | 197 commandManager.assertLastCommand(Command.DELETE, ['2']); |
| 198 }); | 198 }); |
| 199 }); | 199 }); |
| 200 | 200 |
| 201 suite('<bookmarks-list>', function() { | 201 suite('<bookmarks-list>', function() { |
| 202 var list; | 202 var list; |
| 203 var store; | 203 var store; |
| 204 var items; | 204 var items; |
| 205 var multiKey = cr.isMac ? 'meta' : 'ctrl'; | 205 var multiKey = cr.isMac ? 'meta' : 'ctrl'; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 var button = items[0].$$('.more-vert-button'); | 392 var button = items[0].$$('.more-vert-button'); |
| 393 button.focus(); | 393 button.focus(); |
| 394 keydown(button, 'Enter'); | 394 keydown(button, 'Enter'); |
| 395 | 395 |
| 396 assertEquals(button, items[0].root.activeElement); | 396 assertEquals(button, items[0].root.activeElement); |
| 397 }); | 397 }); |
| 398 }); | 398 }); |
| 399 | 399 |
| 400 mocha.run(); | 400 mocha.run(); |
| 401 }); | 401 }); |
| OLD | NEW |