| 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 64755a2f3ce1fea25e9bf214a2f6f3a405a74ad3..90fa5e440b88a2a3f11442c19a66a56cff10adf4 100644
|
| --- a/chrome/test/data/webui/md_bookmarks/test_util.js
|
| +++ b/chrome/test/data/webui/md_bookmarks/test_util.js
|
| @@ -69,3 +69,27 @@ function createItem(id, config) {
|
| }
|
| return newItem;
|
| }
|
| +
|
| +/**
|
| + * Sends a custom click event to |element|.
|
| + * @param {HTMLElement} element
|
| + * @param {Object=} config
|
| + */
|
| +function customClick(element, config) {
|
| + var props = {
|
| + bubbles: true,
|
| + cancelable: true,
|
| + buttons: 1,
|
| + shiftKey: false,
|
| + ctrlKey: false,
|
| + };
|
| +
|
| + if (config) {
|
| + for (var key in config)
|
| + props[key] = config[key];
|
| + }
|
| +
|
| + element.dispatchEvent(new MouseEvent('mousedown', props));
|
| + element.dispatchEvent(new MouseEvent('mouseup', props));
|
| + element.dispatchEvent(new MouseEvent('click', props));
|
| +}
|
|
|