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

Unified Diff: chrome/test/data/webui/md_bookmarks/command_manager_test.js

Issue 2962283002: MD Bookmarks: Add 'show in folder' command to search result context menu (Closed)
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/webui/md_bookmarks/command_manager_test.js
diff --git a/chrome/test/data/webui/md_bookmarks/command_manager_test.js b/chrome/test/data/webui/md_bookmarks/command_manager_test.js
index 61ff0f85b6a41da3ce75ab74c125d3868860b67b..b5f04957d145908c3f81baf2eff54f969a69009a 100644
--- a/chrome/test/data/webui/md_bookmarks/command_manager_test.js
+++ b/chrome/test/data/webui/md_bookmarks/command_manager_test.js
@@ -164,6 +164,26 @@ suite('<bookmarks-command-manager>', function() {
commandManager.assertLastCommand('redo');
});
+ test('Show In Folder is only available during search', function() {
+ assertFalse(
+ commandManager.canExecute(Command.SHOW_IN_FOLDER, new Set(['12'])));
+
+ store.data.search.term = 'test';
+ store.data.search.results = ['12', '13'];
+ store.notifyObservers();
+
+ assertTrue(
+ commandManager.canExecute(Command.SHOW_IN_FOLDER, new Set(['12'])));
+ assertFalse(
+ commandManager.canExecute(Command.SHOW_IN_FOLDER, new Set(['1'])));
+ assertFalse(commandManager.canExecute(
+ Command.SHOW_IN_FOLDER, new Set(['12', '13'])));
+
+ commandManager.handle(Command.SHOW_IN_FOLDER, new Set(['12']));
+ assertEquals('select-folder', store.lastAction.name);
+ assertEquals('1', store.lastAction.id);
+ });
+
test('does not delete children at same time as ancestor', function() {
var lastDelete = null;
chrome.bookmarkManagerPrivate.removeTrees = function(idArray) {

Powered by Google App Engine
This is Rietveld 408576698