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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/md_bookmarks/dnd_manager.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 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 suite('drag and drop', function() { 5 suite('drag and drop', function() {
6 var app; 6 var app;
7 var list; 7 var list;
8 var rootFolderNode; 8 var rootFolderNode;
9 var store; 9 var store;
10 var dndManager; 10 var dndManager;
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 store.notifyObservers(); 464 store.notifyObservers();
465 465
466 dispatchDragEvent('dragstart', dragElement); 466 dispatchDragEvent('dragstart', dragElement);
467 dndManager.dragInfo_.handleChromeDragEnter(createDragData(draggedIds)); 467 dndManager.dragInfo_.handleChromeDragEnter(createDragData(draggedIds));
468 468
469 dispatchDragEvent('dragover', dragTarget); 469 dispatchDragEvent('dragover', dragTarget);
470 assertEquals( 470 assertEquals(
471 DropPosition.NONE, dndManager.calculateValidDropPositions_(dragTarget)); 471 DropPosition.NONE, dndManager.calculateValidDropPositions_(dragTarget));
472 assertDragStyle(dragTarget, DRAG_STYLE.NONE); 472 assertDragStyle(dragTarget, DRAG_STYLE.NONE);
473 }); 473 });
474
475 test('drag item selects/deselects items', function() {
476 store.setReducersEnabled(true);
477
478 store.data.selection.items = new Set(['13', '15']);
479 store.notifyObservers();
480
481 // Dragging an item not in the selection selects the dragged item and
482 // deselects the previous selection.
483 var dragElement = getListItem('14');
484 dispatchDragEvent('dragstart', dragElement);
485 assertDeepEquals(['14'], normalizeSet(store.data.selection.items));
486 dispatchDragEvent('dragend', dragElement);
487
488 // Dragging a folder node deselects any selected items in the bookmark list.
489 dragElement = getFolderNode('15');
490 dispatchDragEvent('dragstart', dragElement);
491 assertDeepEquals([], normalizeSet(store.data.selection.items));
492 dispatchDragEvent('dragend', dragElement);
493 });
474 }); 494 });
OLDNEW
« 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