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

Unified 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: Rebase 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/webui/md_bookmarks/test_util.js
diff --git a/chrome/test/data/webui/md_bookmarks/test_util.js b/chrome/test/data/webui/md_bookmarks/test_util.js
index 593610b359f50d3dbe59a69bafff36e1cd350d05..06dafe80a8f2a40743ec72de6ab80da7f3d7f243 100644
--- a/chrome/test/data/webui/md_bookmarks/test_util.js
+++ b/chrome/test/data/webui/md_bookmarks/test_util.js
@@ -94,14 +94,17 @@ function normalizeSet(set) {
* Sends a custom click event to |element|.
* @param {HTMLElement} element
* @param {Object=} config
+ * @param {string=} eventname
*/
-function customClick(element, config) {
+function customClick(element, config, eventname) {
var props = {
bubbles: true,
cancelable: true,
+ button: 0,
buttons: 1,
shiftKey: false,
ctrlKey: false,
+ detail: 1,
};
if (config) {
@@ -109,9 +112,11 @@ function customClick(element, config) {
props[key] = config[key];
}
+ eventname = eventname || 'click';
+
element.dispatchEvent(new MouseEvent('mousedown', props));
element.dispatchEvent(new MouseEvent('mouseup', props));
- element.dispatchEvent(new MouseEvent('click', props));
+ element.dispatchEvent(new MouseEvent(eventname, props));
}
/**

Powered by Google App Engine
This is Rietveld 408576698