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

Side by Side Diff: chrome/test/data/webui/md_bookmarks/item_test.js

Issue 2814023004: [MD Bookmarks] Right click on bookmark items open context menu. (Closed)
Patch Set: fix_nit Created 3 years, 8 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
« no previous file with comments | « chrome/browser/resources/md_bookmarks/list.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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-item>', function() { 5 suite('<bookmarks-item>', function() {
6 var item; 6 var item;
7 var store; 7 var store;
8 var TEST_ITEM = createItem('0'); 8 var TEST_ITEM = createItem('0');
9 9
10 setup(function() { 10 setup(function() {
(...skipping 30 matching lines...) Expand all
41 assertFalse(item.$['folder-icon'].hidden); 41 assertFalse(item.$['folder-icon'].hidden);
42 assertTrue(item.$.icon.hidden); 42 assertTrue(item.$.icon.hidden);
43 }); 43 });
44 44
45 test('pressing the menu button selects the item', function() { 45 test('pressing the menu button selects the item', function() {
46 MockInteractions.tap(item.$$('.more-vert-button')); 46 MockInteractions.tap(item.$$('.more-vert-button'));
47 assertDeepEquals( 47 assertDeepEquals(
48 bookmarks.actions.selectItem('2', false, false, store.data), 48 bookmarks.actions.selectItem('2', false, false, store.data),
49 store.lastAction); 49 store.lastAction);
50 }); 50 });
51
52 test('context menu selects item if unselected', function() {
53 item.isSelectedItem_ = true;
54 item.dispatchEvent(new MouseEvent('contextmenu'));
55 assertEquals(null, store.lastAction);
56
57 item.isSelectedItem_ = false;
58 item.dispatchEvent(new MouseEvent('contextmenu'));
59 assertDeepEquals(
60 bookmarks.actions.selectItem('2', false, false, store.data),
61 store.lastAction);
62 });
51 }); 63 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/list.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698