OLD | NEW |
---|---|
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 id: id, | 62 id: id, |
63 title: '', | 63 title: '', |
64 url: 'http://www.google.com/', | 64 url: 'http://www.google.com/', |
65 }; | 65 }; |
66 if (config) { | 66 if (config) { |
67 for (var key in config) | 67 for (var key in config) |
68 newItem[key] = config[key]; | 68 newItem[key] = config[key]; |
69 } | 69 } |
70 return newItem; | 70 return newItem; |
71 } | 71 } |
72 | |
73 /** | |
74 * Sends a custom click event to |element|. | |
75 * @param {HTMLElement} element | |
76 * @param {Object} config | |
77 */ | |
78 function customClick(element, config) { | |
calamity
2017/01/17 06:12:22
I would fill out config with a useful set of defau
jiaxi
2017/01/20 04:51:09
Done.
| |
79 element.dispatchEvent(new MouseEvent('mousedown', config)); | |
80 element.dispatchEvent(new MouseEvent('mouseup', config)); | |
81 element.dispatchEvent(new MouseEvent('click', config)); | |
82 } | |
OLD | NEW |