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

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

Issue 2740863003: MD Bookmarks: Implement search and selection in new data flow system (Closed)
Patch Set: Review round 2 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 unified diff | Download patch
« no previous file with comments | « chrome/test/data/webui/md_bookmarks/sidebar_test.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 /** 5 /**
6 * Replace the current body of the test with a new element. 6 * Replace the current body of the test with a new element.
7 * @param {Element} element 7 * @param {Element} element
8 */ 8 */
9 function replaceBody(element) { 9 function replaceBody(element) {
10 PolymerTest.clearBody(); 10 PolymerTest.clearBody();
11 document.body.appendChild(element); 11 document.body.appendChild(element);
12 } 12 }
13 13
14 /** 14 /**
15 * Convert a tree of bookmark nodes into a normalized lookup table of nodes. 15 * Convert a list of top-level bookmark nodes into a normalized lookup table of
16 * nodes.
17 * @param {...BookmarkTreeNode} nodes
16 */ 18 */
17 function testTree(root) { 19 function testTree(nodes) {
18 return bookmarks.util.normalizeNodes(root); 20 return bookmarks.util.normalizeNodes(
21 createFolder('0', Array.from(arguments)));
19 } 22 }
20 23
21 /** 24 /**
22 * Creates a folder with given properties. 25 * Creates a folder with given properties.
23 * @param {string} id 26 * @param {string} id
24 * @param {Array<BookmarkTreeNode>} children 27 * @param {Array<BookmarkTreeNode>} children
25 * @param {Object=} config 28 * @param {Object=} config
26 * @return {BookmarkTreeNode} 29 * @return {BookmarkTreeNode}
27 */ 30 */
28 function createFolder(id, children, config) { 31 function createFolder(id, children, config) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 95
93 if (config) { 96 if (config) {
94 for (var key in config) 97 for (var key in config)
95 props[key] = config[key]; 98 props[key] = config[key];
96 } 99 }
97 100
98 element.dispatchEvent(new MouseEvent('mousedown', props)); 101 element.dispatchEvent(new MouseEvent('mousedown', props));
99 element.dispatchEvent(new MouseEvent('mouseup', props)); 102 element.dispatchEvent(new MouseEvent('mouseup', props));
100 element.dispatchEvent(new MouseEvent('click', props)); 103 element.dispatchEvent(new MouseEvent('click', props));
101 } 104 }
OLDNEW
« no previous file with comments | « chrome/test/data/webui/md_bookmarks/sidebar_test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698