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

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

Issue 2239623002: [MD History] Add shift-selection to the history lists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@reshadow
Patch Set: rebase, fix closure compile Created 4 years, 4 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_history/history_list_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 * Waits for queued up tasks to finish before proceeding. Inspired by: 6 * Waits for queued up tasks to finish before proceeding. Inspired by:
7 * https://github.com/Polymer/web-component-tester/blob/master/browser/environme nt/helpers.js#L97 7 * https://github.com/Polymer/web-component-tester/blob/master/browser/environme nt/helpers.js#L97
8 */ 8 */
9 function flush() { 9 function flush() {
10 Polymer.dom.flush(); 10 Polymer.dom.flush();
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 if (!predicate(e)) 102 if (!predicate(e))
103 return; 103 return;
104 104
105 resolve(); 105 resolve();
106 element.removeEventListener(eventName, listener); 106 element.removeEventListener(eventName, listener);
107 } 107 }
108 108
109 element.addEventListener(eventName, listener); 109 element.addEventListener(eventName, listener);
110 }); 110 });
111 } 111 }
112
113 /**
114 * Sends a shift click event to |element|.
115 * @param {HTMLElement} element
116 */
117 function shiftClick(element) {
118 var xy = MockInteractions.middleOfNode(element);
119 var props = {
120 bubbles: true,
121 cancelable: true,
122 clientX: xy.x,
123 clientY: xy.y,
124 buttons: 1,
125 shiftKey: true,
126 };
127
128 element.dispatchEvent(new MouseEvent('mousedown', props));
129 element.dispatchEvent(new MouseEvent('mouseup', props));
130 element.dispatchEvent(new MouseEvent('click', props));
131 }
OLDNEW
« no previous file with comments | « chrome/test/data/webui/md_history/history_list_test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698