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

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

Issue 2872163002: MD Bookmarks: Add 'Open' command, to open in either the BMM or in new tabs (Closed)
Patch Set: Rebase 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 /** 5 /**
6 * @fileoverview Test suite for action creators that depend on the page state 6 * @fileoverview Test suite for action creators that depend on the page state
7 * and/or have non-trivial logic. 7 * and/or have non-trivial logic.
8 */ 8 */
9 9
10 suite('selectItem', function() { 10 suite('selectItem', function() {
(...skipping 23 matching lines...) Expand all
34 anchor: '2', 34 anchor: '2',
35 }; 35 };
36 assertDeepEquals(expected, action); 36 assertDeepEquals(expected, action);
37 }); 37 });
38 38
39 test('can shift-select in regular list', function() { 39 test('can shift-select in regular list', function() {
40 store.data.selection.anchor = '2'; 40 store.data.selection.anchor = '2';
41 action = bookmarks.actions.selectItem('4', false, true, store.data); 41 action = bookmarks.actions.selectItem('4', false, true, store.data);
42 42
43 assertDeepEquals(['2', '8', '4'], action.items); 43 assertDeepEquals(['2', '8', '4'], action.items);
44 assertDeepEquals('4', action.anchor); 44 // Shift-selection doesn't change anchor.
45 assertDeepEquals('2', action.anchor);
45 }); 46 });
46 47
47 test('can shift-select in search results', function() { 48 test('can shift-select in search results', function() {
48 store.data.selectedFolder = null; 49 store.data.selectedFolder = null;
49 store.data.search = { 50 store.data.search = {
50 term: 'test', 51 term: 'test',
51 results: ['1', '4', '8'], 52 results: ['1', '4', '8'],
52 inProgress: false, 53 inProgress: false,
53 }; 54 };
54 store.data.selection.anchor = '8'; 55 store.data.selection.anchor = '8';
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 action = bookmarks.actions.selectFolder('2', nodes); 87 action = bookmarks.actions.selectFolder('2', nodes);
87 assertEquals(null, action); 88 assertEquals(null, action);
88 89
89 action = bookmarks.actions.selectFolder('42', nodes); 90 action = bookmarks.actions.selectFolder('42', nodes);
90 assertEquals(null, action); 91 assertEquals(null, action);
91 92
92 action = bookmarks.actions.selectFolder('1', nodes); 93 action = bookmarks.actions.selectFolder('1', nodes);
93 assertEquals('select-folder', action.name); 94 assertEquals('select-folder', action.name);
94 assertEquals('1', action.id); 95 assertEquals('1', action.id);
95 }); 96 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/item.js ('k') | chrome/test/data/webui/md_bookmarks/command_manager_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698