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

Side by Side Diff: chrome/test/data/webui/md_bookmarks/md_bookmarks_focus_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 unified diff | Download patch
OLDNEW
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
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
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 });
OLDNEW
« no previous file with comments | « chrome/test/data/webui/md_bookmarks/command_manager_test.js ('k') | ui/webui/resources/js/cr/ui/command.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698