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

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

Issue 2926233002: MD Bookmarks: Add right-click context menu to sidebar folders (Closed)
Patch Set: Don't reselect folder Created 3 years, 6 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/folder_node_test.js
diff --git a/chrome/test/data/webui/md_bookmarks/folder_node_test.js b/chrome/test/data/webui/md_bookmarks/folder_node_test.js
index 7a0a5f980dc330ca18a38a0480391964259fda1c..bd3790c139eeb3575a947bca665b37aaec459ef1 100644
--- a/chrome/test/data/webui/md_bookmarks/folder_node_test.js
+++ b/chrome/test/data/webui/md_bookmarks/folder_node_test.js
@@ -44,16 +44,22 @@ suite('<bookmarks-folder-node>', function() {
firstGen[0].$['descendants'].querySelectorAll('bookmarks-folder-node');
// Select nested folder.
- firedId = '';
MockInteractions.tap(secondGen[0].$['folder-label']);
assertEquals('select-folder', store.lastAction.name);
assertEquals(secondGen[0].itemId, store.lastAction.id);
// Select folder in a separate subtree.
- firedId = '';
MockInteractions.tap(rootFolders[1].$['folder-label']);
assertEquals('select-folder', store.lastAction.name);
assertEquals(rootFolders[1].itemId, store.lastAction.id);
+
+ // Doesn't re-select if the folder is already selected.
+ store.data.selectedFolder = '7';
+ store.notifyObservers();
+ store.resetLastAction();
+
+ MockInteractions.tap(rootFolders[1].$['folder-label']);
+ assertEquals(null, store.lastAction);
});
test('depth calculation', function() {
@@ -131,4 +137,15 @@ suite('<bookmarks-folder-node>', function() {
assertEquals(null, getNextChild('1', '2', false));
assertEquals('2', getNextChild('0', '7', true).itemId);
});
+
+ test('right click opens context menu', function() {
+ var commandManager = new TestCommandManager();
+ document.body.appendChild(commandManager);
+
+ var node = getFolderNode('2');
+ node.$.container.dispatchEvent(new MouseEvent('contextmenu'));
+
+ assertDeepEquals(bookmarks.actions.selectFolder('2'), store.lastAction);
+ commandManager.assertMenuOpenForIds(['2']);
+ });
});
« no previous file with comments | « chrome/browser/resources/md_bookmarks/folder_node.js ('k') | chrome/test/data/webui/md_bookmarks/test_command_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698