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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 suite('<bookmarks-folder-node>', function() { 5 suite('<bookmarks-folder-node>', function() {
6 var rootNode; 6 var rootNode;
7 var store; 7 var store;
8 8
9 function getFolderNode(id) { 9 function getFolderNode(id) {
10 return findFolderNode(rootNode, id); 10 return findFolderNode(rootNode, id);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 assertEquals('3', getNextChild('2', '4', true).itemId); 124 assertEquals('3', getNextChild('2', '4', true).itemId);
125 assertEquals('4', getNextChild('0', '7', true).itemId); 125 assertEquals('4', getNextChild('0', '7', true).itemId);
126 126
127 // Skips closed folders. 127 // Skips closed folders.
128 store.data.closedFolders = new Set('2'); 128 store.data.closedFolders = new Set('2');
129 store.notifyObservers(); 129 store.notifyObservers();
130 130
131 assertEquals(null, getNextChild('1', '2', false)); 131 assertEquals(null, getNextChild('1', '2', false));
132 assertEquals('2', getNextChild('0', '7', true).itemId); 132 assertEquals('2', getNextChild('0', '7', true).itemId);
133 }); 133 });
134
135 test('right click opens context menu', function() {
136 var commandManager = new TestCommandManager();
137 document.body.appendChild(commandManager);
138
139 var node = getFolderNode('2');
140 node.$.container.dispatchEvent(new MouseEvent('contextmenu'));
141
142 assertDeepEquals(bookmarks.actions.selectFolder('2'), store.lastAction);
143 commandManager.assertMenuOpenForIds(['2']);
144 });
134 }); 145 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698