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

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

Issue 2871573004: [MD Bookmarks] Make dragging update selected items. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/md_bookmarks/dnd_manager.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/md_bookmarks/dnd_manager_test.js
diff --git a/chrome/test/data/webui/md_bookmarks/dnd_manager_test.js b/chrome/test/data/webui/md_bookmarks/dnd_manager_test.js
index 2c373334b7acca39884fb677ab14ec2bdd1e1ac3..d0276a1d2dcb5341f542b73331aa23e24118d426 100644
--- a/chrome/test/data/webui/md_bookmarks/dnd_manager_test.js
+++ b/chrome/test/data/webui/md_bookmarks/dnd_manager_test.js
@@ -471,4 +471,24 @@ suite('drag and drop', function() {
DropPosition.NONE, dndManager.calculateValidDropPositions_(dragTarget));
assertDragStyle(dragTarget, DRAG_STYLE.NONE);
});
+
+ test('drag item selects/deselects items', function() {
+ store.setReducersEnabled(true);
+
+ store.data.selection.items = new Set(['13', '15']);
+ store.notifyObservers();
+
+ // Dragging an item not in the selection selects the dragged item and
+ // deselects the previous selection.
+ var dragElement = getListItem('14');
+ dispatchDragEvent('dragstart', dragElement);
+ assertDeepEquals(['14'], normalizeSet(store.data.selection.items));
+ dispatchDragEvent('dragend', dragElement);
+
+ // Dragging a folder node deselects any selected items in the bookmark list.
+ dragElement = getFolderNode('15');
+ dispatchDragEvent('dragstart', dragElement);
+ assertDeepEquals([], normalizeSet(store.data.selection.items));
+ dispatchDragEvent('dragend', dragElement);
+ });
});
« no previous file with comments | « chrome/browser/resources/md_bookmarks/dnd_manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698