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

Side by Side Diff: chrome/test/data/webui/md_bookmarks/md_bookmarks_focus_test.js

Issue 2912893002: MD Bookmarks: Support policies for disabling bookmark editing (Closed)
Patch Set: Review comments 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 179
180 document.body.style.direction = 'ltr'; 180 document.body.style.direction = 'ltr';
181 }); 181 });
182 182
183 test('keyboard commands are passed to command manager', function() { 183 test('keyboard commands are passed to command manager', function() {
184 var commandManager = new TestCommandManager(); 184 var commandManager = new TestCommandManager();
185 document.body.appendChild(commandManager); 185 document.body.appendChild(commandManager);
186 chrome.bookmarkManagerPrivate.removeTrees = function() {} 186 chrome.bookmarkManagerPrivate.removeTrees = function() {}
187 187
188 store.data.selection.items = new Set(['3', '4']); 188 store.data.selection.items = new Set(['3', '4']);
189 store.data.selectedFolder = '2';
189 store.notifyObservers(); 190 store.notifyObservers();
190 191
191 getFolderNode('1').$.container.focus(); 192 getFolderNode('2').$.container.focus();
192 keydown('1', 'delete'); 193 keydown('2', 'delete');
193 194
194 commandManager.assertLastCommand(Command.DELETE, ['1']); 195 commandManager.assertLastCommand(Command.DELETE, ['2']);
195 }); 196 });
196 }); 197 });
197 198
198 suite('<bookmarks-list>', function() { 199 suite('<bookmarks-list>', function() {
199 var list; 200 var list;
200 var store; 201 var store;
201 var items; 202 var items;
202 var multiKey = cr.isMac ? 'meta' : 'ctrl'; 203 var multiKey = cr.isMac ? 'meta' : 'ctrl';
203 204
204 function keydown(item, key, modifiers) { 205 function keydown(item, key, modifiers) {
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 var button = items[0].$$('.more-vert-button'); 390 var button = items[0].$$('.more-vert-button');
390 button.focus(); 391 button.focus();
391 keydown(button, 'Enter'); 392 keydown(button, 'Enter');
392 393
393 assertEquals(button, items[0].root.activeElement); 394 assertEquals(button, items[0].root.activeElement);
394 }); 395 });
395 }); 396 });
396 397
397 mocha.run(); 398 mocha.run();
398 }); 399 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698