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

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: Split out file 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..ea10a2a30b46f6bd47a0f5918314b606287973bc
--- /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(lastCommand, command);
+ if (ids)
+ assertDeepEquals(normalizeSet(lastCommandIds), ids);
calamity 2017/05/23 05:46:03 nit: Flip the assert args here and above.
tsergeant 2017/05/23 06:50:42 Done.
+ 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