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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/webui/md_bookmarks/test_command_manager.js
diff --git a/chrome/test/data/webui/md_bookmarks/test_command_manager.js b/chrome/test/data/webui/md_bookmarks/test_command_manager.js
new file mode 100644
index 0000000000000000000000000000000000000000..7dbc970708454e7b9e27ee1320a2e17edfd8aadd
--- /dev/null
+++ b/chrome/test/data/webui/md_bookmarks/test_command_manager.js
@@ -0,0 +1,31 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * Creates and returns a CommandManager which tracks what commands are executed.
+ * @constructor
+ * @extends {bookmarks.CommandManager}
+ */
+function TestCommandManager() {
+ var commandManager = document.createElement('bookmarks-command-manager');
+ var lastCommand = null;
+ var lastCommandIds = null;
+
+ var realHandle = commandManager.handle.bind(commandManager);
+ commandManager.handle = function(command, itemIds) {
+ lastCommand = command;
+ lastCommandIds = itemIds;
+ realHandle(command, itemIds);
+ };
+
+ commandManager.assertLastCommand = function (command, ids) {
+ assertEquals(command, lastCommand);
+ if (ids)
+ assertDeepEquals(ids, normalizeSet(lastCommandIds));
+ lastCommand = null;
+ lastCommandIds = null;
+ };
+
+ return commandManager;
+}
« 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