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

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

Issue 2926763005: [MD Bookmarks] Refactor window timer mocking. (Closed)
Patch Set: Created 3 years, 6 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
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 chrome.bookmarkManagerPrivate.startDrag = function(nodes, isTouch) { 94 chrome.bookmarkManagerPrivate.startDrag = function(nodes, isTouch) {
95 draggedIds = nodes; 95 draggedIds = nodes;
96 }; 96 };
97 97
98 app = document.createElement('bookmarks-app'); 98 app = document.createElement('bookmarks-app');
99 replaceBody(app); 99 replaceBody(app);
100 list = app.$$('bookmarks-list'); 100 list = app.$$('bookmarks-list');
101 rootFolderNode = app.$$('bookmarks-folder-node'); 101 rootFolderNode = app.$$('bookmarks-folder-node');
102 dndManager = app.dndManager_; 102 dndManager = app.dndManager_;
103 dndManager.disableTimeoutsForTesting(); 103 dndManager.setTimerProxyForTesting(new bookmarks.TestTimerProxy());
104 Polymer.dom.flush(); 104 Polymer.dom.flush();
105 }); 105 });
106 106
107 test('dragInfo isDraggingFolderToDescendant', function() { 107 test('dragInfo isDraggingFolderToDescendant', function() {
108 var dragInfo = new bookmarks.DragInfo(); 108 var dragInfo = new bookmarks.DragInfo();
109 var nodes = store.data.nodes; 109 var nodes = store.data.nodes;
110 dragInfo.handleChromeDragEnter(createDragData(['11'])); 110 dragInfo.handleChromeDragEnter(createDragData(['11']));
111 assertTrue(dragInfo.isDraggingFolderToDescendant('111', nodes)); 111 assertTrue(dragInfo.isDraggingFolderToDescendant('111', nodes));
112 assertFalse(dragInfo.isDraggingFolderToDescendant('1', nodes)); 112 assertFalse(dragInfo.isDraggingFolderToDescendant('1', nodes));
113 assertFalse(dragInfo.isDraggingFolderToDescendant('2', nodes)); 113 assertFalse(dragInfo.isDraggingFolderToDescendant('2', nodes));
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 assertDeepEquals(['14'], normalizeSet(store.data.selection.items)); 484 assertDeepEquals(['14'], normalizeSet(store.data.selection.items));
485 dispatchDragEvent('dragend', dragElement); 485 dispatchDragEvent('dragend', dragElement);
486 486
487 // 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.
488 dragElement = getFolderNode('15'); 488 dragElement = getFolderNode('15');
489 dispatchDragEvent('dragstart', dragElement); 489 dispatchDragEvent('dragstart', dragElement);
490 assertDeepEquals([], normalizeSet(store.data.selection.items)); 490 assertDeepEquals([], normalizeSet(store.data.selection.items));
491 dispatchDragEvent('dragend', dragElement); 491 dispatchDragEvent('dragend', dragElement);
492 }); 492 });
493 }); 493 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698