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

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

Issue 2956213002: [MD Bookmarks] Make disabled buttons in context menu do nothing when clicked. (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « chrome/browser/resources/md_bookmarks/command_manager.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 suite('<bookmarks-command-manager>', function() { 5 suite('<bookmarks-command-manager>', function() {
6 var commandManager; 6 var commandManager;
7 var store; 7 var store;
8 var lastCommand; 8 var lastCommand;
9 var lastCommandIds; 9 var lastCommandIds;
10 10
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 assertFalse(commandManager.canExecute(Command.EDIT, items)); 252 assertFalse(commandManager.canExecute(Command.EDIT, items));
253 assertFalse(commandManager.canExecute(Command.DELETE, items)); 253 assertFalse(commandManager.canExecute(Command.DELETE, items));
254 assertFalse(commandManager.canExecute(Command.UNDO, items)); 254 assertFalse(commandManager.canExecute(Command.UNDO, items));
255 assertFalse(commandManager.canExecute(Command.REDO, items)); 255 assertFalse(commandManager.canExecute(Command.REDO, items));
256 256
257 // No divider line should be visible when only 'Open' commands are enabled. 257 // No divider line should be visible when only 'Open' commands are enabled.
258 commandManager.openCommandMenuAtPosition(0, 0); 258 commandManager.openCommandMenuAtPosition(0, 0);
259 commandManager.root.querySelectorAll('hr').forEach(element => { 259 commandManager.root.querySelectorAll('hr').forEach(element => {
260 assertTrue(element.hidden); 260 assertTrue(element.hidden);
261 }); 261 });
262
263 var commandItem = {};
tsergeant 2017/06/28 04:42:06 I think this is the slightly wrong place to put th
calamity 2017/06/28 04:55:06 Done.
264 commandManager.root.querySelectorAll('.dropdown-item').forEach(element => {
265 commandItem[element.getAttribute('command')] = element;
266 });
267 MockInteractions.tap(commandItem[Command.EDIT]);
268 commandManager.assertLastCommand(null);
262 }); 269 });
263 270
264 test('cannot edit unmodifiable nodes', function() { 271 test('cannot edit unmodifiable nodes', function() {
265 // Cannot edit root folders. 272 // Cannot edit root folders.
266 var items = new Set(['1']); 273 var items = new Set(['1']);
267 assertFalse(commandManager.canExecute(Command.EDIT, items)); 274 assertFalse(commandManager.canExecute(Command.EDIT, items));
268 assertFalse(commandManager.canExecute(Command.DELETE, items)); 275 assertFalse(commandManager.canExecute(Command.DELETE, items));
269 276
270 store.data.nodes['12'].unmodifiable = 'managed'; 277 store.data.nodes['12'].unmodifiable = 'managed';
271 store.notifyObservers(); 278 store.notifyObservers();
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 assertOpenedTabs(['http://111/', 'http://12/']); 352 assertOpenedTabs(['http://111/', 'http://12/']);
346 }); 353 });
347 354
348 test('control-double click opens full selection', function() { 355 test('control-double click opens full selection', function() {
349 customClick(items[0]); 356 customClick(items[0]);
350 simulateDoubleClick(items[2], {ctrlKey: true}); 357 simulateDoubleClick(items[2], {ctrlKey: true});
351 358
352 assertOpenedTabs(['http://111/', 'http://13/']); 359 assertOpenedTabs(['http://111/', 'http://13/']);
353 }); 360 });
354 }); 361 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/command_manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698