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

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

Issue 2872163002: MD Bookmarks: Add 'Open' command, to open in either the BMM or in new tabs (Closed)
Patch Set: Open items with middle-click 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/item.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();
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 * @param {HTMLElement} element 95 * @param {HTMLElement} element
96 * @param {Object=} config 96 * @param {Object=} config
97 */ 97 */
98 function customClick(element, config) { 98 function customClick(element, config) {
99 var props = { 99 var props = {
100 bubbles: true, 100 bubbles: true,
101 cancelable: true, 101 cancelable: true,
102 buttons: 1, 102 buttons: 1,
103 shiftKey: false, 103 shiftKey: false,
104 ctrlKey: false, 104 ctrlKey: false,
105 detail: 1,
105 }; 106 };
106 107
107 if (config) { 108 if (config) {
108 for (var key in config) 109 for (var key in config)
109 props[key] = config[key]; 110 props[key] = config[key];
110 } 111 }
111 112
112 element.dispatchEvent(new MouseEvent('mousedown', props)); 113 element.dispatchEvent(new MouseEvent('mousedown', props));
113 element.dispatchEvent(new MouseEvent('mouseup', props)); 114 element.dispatchEvent(new MouseEvent('mouseup', props));
114 element.dispatchEvent(new MouseEvent('click', props)); 115 element.dispatchEvent(new MouseEvent('click', props));
(...skipping 10 matching lines...) Expand all
125 var node; 126 var node;
126 while (nodes.length) { 127 while (nodes.length) {
127 node = nodes.pop(); 128 node = nodes.pop();
128 if (node.itemId == id) 129 if (node.itemId == id)
129 return node; 130 return node;
130 131
131 node.root.querySelectorAll('bookmarks-folder-node') 132 node.root.querySelectorAll('bookmarks-folder-node')
132 .forEach((x) => {nodes.unshift(x)}); 133 .forEach((x) => {nodes.unshift(x)});
133 } 134 }
134 } 135 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/item.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698