| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |