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

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

Issue 2884233003: [MD Bookmarks] Clear drop indicator when dragging over invalid target. (Closed)
Patch Set: 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 dispatchDragEvent('dragover', dragTarget); 142 dispatchDragEvent('dragover', dragTarget);
143 assertEquals( 143 assertEquals(
144 DropPosition.ON | DropPosition.ABOVE | DropPosition.BELOW, 144 DropPosition.ON | DropPosition.ABOVE | DropPosition.BELOW,
145 dndManager.calculateValidDropPositions_(dragTarget)); 145 dndManager.calculateValidDropPositions_(dragTarget));
146 assertDragStyle(dragTarget, DRAG_STYLE.ON); 146 assertDragStyle(dragTarget, DRAG_STYLE.ON);
147 147
148 // There are no valid drop locations for dragging an item onto itself. 148 // There are no valid drop locations for dragging an item onto itself.
149 assertEquals( 149 assertEquals(
150 DropPosition.NONE, 150 DropPosition.NONE,
151 dndManager.calculateValidDropPositions_(dragElement)); 151 dndManager.calculateValidDropPositions_(dragElement));
152 dispatchDragEvent('dragleave', dragTarget);
153 dispatchDragEvent('dragover', dragElement); 152 dispatchDragEvent('dragover', dragElement);
154 153
155 assertDragStyle(dragTarget, DRAG_STYLE.NONE); 154 assertDragStyle(dragTarget, DRAG_STYLE.NONE);
156 assertDragStyle(dragElement, DRAG_STYLE.NONE); 155 assertDragStyle(dragElement, DRAG_STYLE.NONE);
157 }); 156 });
158 157
159 test('reorder folder nodes', function() { 158 test('reorder folder nodes', function() {
160 var dragElement = getFolderNode('112'); 159 var dragElement = getFolderNode('112');
161 var dragTarget = getFolderNode('111'); 160 var dragTarget = getFolderNode('111');
162 dispatchDragEvent('dragstart', dragElement); 161 dispatchDragEvent('dragstart', dragElement);
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 assertDeepEquals(['14'], normalizeSet(store.data.selection.items)); 484 assertDeepEquals(['14'], normalizeSet(store.data.selection.items));
486 dispatchDragEvent('dragend', dragElement); 485 dispatchDragEvent('dragend', dragElement);
487 486
488 // Dragging a folder node deselects any selected items in the bookmark list. 487 // Dragging a folder node deselects any selected items in the bookmark list.
489 dragElement = getFolderNode('15'); 488 dragElement = getFolderNode('15');
490 dispatchDragEvent('dragstart', dragElement); 489 dispatchDragEvent('dragstart', dragElement);
491 assertDeepEquals([], normalizeSet(store.data.selection.items)); 490 assertDeepEquals([], normalizeSet(store.data.selection.items));
492 dispatchDragEvent('dragend', dragElement); 491 dispatchDragEvent('dragend', dragElement);
493 }); 492 });
494 }); 493 });
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