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(); |
| 11 |
| 12 window.history.replaceState({}, '', '/'); |
| 13 |
11 document.body.appendChild(element); | 14 document.body.appendChild(element); |
12 } | 15 } |
13 | 16 |
14 /** | 17 /** |
15 * Convert a list of top-level bookmark nodes into a normalized lookup table of | 18 * Convert a list of top-level bookmark nodes into a normalized lookup table of |
16 * nodes. | 19 * nodes. |
17 * @param {...BookmarkTreeNode} nodes | 20 * @param {...BookmarkTreeNode} nodes |
18 */ | 21 */ |
19 function testTree(nodes) { | 22 function testTree(nodes) { |
20 return bookmarks.util.normalizeNodes( | 23 return bookmarks.util.normalizeNodes( |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 98 |
96 if (config) { | 99 if (config) { |
97 for (var key in config) | 100 for (var key in config) |
98 props[key] = config[key]; | 101 props[key] = config[key]; |
99 } | 102 } |
100 | 103 |
101 element.dispatchEvent(new MouseEvent('mousedown', props)); | 104 element.dispatchEvent(new MouseEvent('mousedown', props)); |
102 element.dispatchEvent(new MouseEvent('mouseup', props)); | 105 element.dispatchEvent(new MouseEvent('mouseup', props)); |
103 element.dispatchEvent(new MouseEvent('click', props)); | 106 element.dispatchEvent(new MouseEvent('click', props)); |
104 } | 107 } |
OLD | NEW |