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

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

Issue 2888863002: [MD Bookmarks] Refine mouse selection (Closed)
Patch Set: address comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/md_bookmarks/reducers.js ('k') | chrome/test/data/webui/md_bookmarks/item_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/md_bookmarks/actions_test.js
diff --git a/chrome/test/data/webui/md_bookmarks/actions_test.js b/chrome/test/data/webui/md_bookmarks/actions_test.js
index c952e4a39dcd9795b048cd639772655471bab154..88be6d46bca3ed96b2f033c47f56cab3c1a8605e 100644
--- a/chrome/test/data/webui/md_bookmarks/actions_test.js
+++ b/chrome/test/data/webui/md_bookmarks/actions_test.js
@@ -26,11 +26,16 @@ suite('selectItem', function() {
});
test('can select single item', function() {
- action = bookmarks.actions.selectItem('2', true, false, store.data);
+ action = bookmarks.actions.selectItem('2', store.data, {
+ clear: false,
+ range: false,
+ toggle: false,
+ });
var expected = {
name: 'select-items',
items: ['2'],
- add: true,
+ clear: false,
+ toggle: false,
anchor: '2',
};
assertDeepEquals(expected, action);
@@ -38,7 +43,11 @@ suite('selectItem', function() {
test('can shift-select in regular list', function() {
store.data.selection.anchor = '2';
- action = bookmarks.actions.selectItem('4', false, true, store.data);
+ action = bookmarks.actions.selectItem('4', store.data, {
+ clear: true,
+ range: true,
+ toggle: false,
+ });
assertDeepEquals(['2', '8', '4'], action.items);
// Shift-selection doesn't change anchor.
@@ -54,7 +63,11 @@ suite('selectItem', function() {
};
store.data.selection.anchor = '8';
- action = bookmarks.actions.selectItem('4', false, true, store.data);
+ action = bookmarks.actions.selectItem('4', store.data, {
+ clear: true,
+ range: true,
+ toggle: false,
+ });
assertDeepEquals(['4', '8'], action.items);
});
@@ -63,14 +76,22 @@ suite('selectItem', function() {
// Anchor hasn't been set yet.
store.data.selection.anchor = null;
- action = bookmarks.actions.selectItem('4', true, true, store.data);
+ action = bookmarks.actions.selectItem('4', store.data, {
+ clear: false,
+ range: true,
+ toggle: false,
+ });
assertEquals('4', action.anchor);
assertDeepEquals(['4'], action.items);
// Anchor set to an item which doesn't exist.
store.data.selection.anchor = '42';
- action = bookmarks.actions.selectItem('8', true, true, store.data);
+ action = bookmarks.actions.selectItem('8', store.data, {
+ clear: false,
+ range: true,
+ toggle: false,
+ });
assertEquals('8', action.anchor);
assertDeepEquals(['8'], action.items);
});
« no previous file with comments | « chrome/browser/resources/md_bookmarks/reducers.js ('k') | chrome/test/data/webui/md_bookmarks/item_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698