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

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

Issue 2893833002: MD Bookmarks: Enable the delete button in the toolbar overlay (Closed)
Patch Set: Fix nit Created 3 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 /**
6 * Creates and returns a CommandManager which tracks what commands are executed.
7 * @constructor
8 * @extends {bookmarks.CommandManager}
9 */
10 function TestCommandManager() {
11 var commandManager = document.createElement('bookmarks-command-manager');
12 var lastCommand = null;
13 var lastCommandIds = null;
14
15 var realHandle = commandManager.handle.bind(commandManager);
16 commandManager.handle = function(command, itemIds) {
17 lastCommand = command;
18 lastCommandIds = itemIds;
19 realHandle(command, itemIds);
20 };
21
22 commandManager.assertLastCommand = function (command, ids) {
23 assertEquals(command, lastCommand);
24 if (ids)
25 assertDeepEquals(ids, normalizeSet(lastCommandIds));
26 lastCommand = null;
27 lastCommandIds = null;
28 };
29
30 return commandManager;
31 }
OLDNEW
« no previous file with comments | « chrome/test/data/webui/md_bookmarks/md_bookmarks_browsertest.js ('k') | chrome/test/data/webui/md_bookmarks/toolbar_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698