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

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

Issue 2741393002: MD Bookmarks: Implement item selection in new data flow system (Closed)
Patch Set: Created 3 years, 9 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/list_test.js
diff --git a/chrome/test/data/webui/md_bookmarks/list_test.js b/chrome/test/data/webui/md_bookmarks/list_test.js
index 62de4f3e6d6a35d3466ccee0137733037629c630..500b574dd15c513104263f8905fc0f6f8dd51148 100644
--- a/chrome/test/data/webui/md_bookmarks/list_test.js
+++ b/chrome/test/data/webui/md_bookmarks/list_test.js
@@ -65,4 +65,35 @@ suite('<bookmarks-list>', function() {
assertDeepEquals(['1', '3', '5', '7'], ids);
});
+
+ test('selects individual items', function() {
+ var items = list.root.querySelectorAll('bookmarks-item');
+
+ customClick(items[0]);
+ var expected = {
+ name: 'select-items',
+ add: false,
+ anchor: '1',
+ items: ['1'],
+ };
+ assertDeepEquals(expected, store.lastAction);
+
+ customClick(items[2], {ctrlKey: true});
+ expected.add = true;
+ expected.anchor = '5';
+ expected.items = ['5'];
+ assertDeepEquals(expected, store.lastAction);
+ });
+
+ test('shift-selects multiple items', function() {
+ var items = list.root.querySelectorAll('bookmarks-item');
+ store.data.selection.anchor = '1';
+
+ customClick(items[2], {shiftKey: true});
+
+ assertEquals('select-items', store.lastAction.name);
+ assertFalse(store.lastAction.add);
+ assertEquals('5', store.lastAction.anchor);
+ assertDeepEquals(['1', '3', '5'], store.lastAction.items);
+ });
});

Powered by Google App Engine
This is Rietveld 408576698