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

Side by Side Diff: chrome/test/data/webui/md_bookmarks/test_util.js

Issue 2774233006: [MD Bookmarks] Change selection items from Map to Set. (Closed)
Patch Set: rebase Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « chrome/test/data/webui/md_bookmarks/reducers_test.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 url: 'http://www.google.com/', 76 url: 'http://www.google.com/',
77 }; 77 };
78 if (config) { 78 if (config) {
79 for (var key in config) 79 for (var key in config)
80 newItem[key] = config[key]; 80 newItem[key] = config[key];
81 } 81 }
82 return newItem; 82 return newItem;
83 } 83 }
84 84
85 /** 85 /**
86 * @param {Set<T>}
87 * @return {Array<T>}
88 * @template T
89 */
90 function normalizeSet(set) {
91 return Array.from(set).sort();
92 }
93
94 /**
86 * Sends a custom click event to |element|. 95 * Sends a custom click event to |element|.
87 * @param {HTMLElement} element 96 * @param {HTMLElement} element
88 * @param {Object=} config 97 * @param {Object=} config
89 */ 98 */
90 function customClick(element, config) { 99 function customClick(element, config) {
91 var props = { 100 var props = {
92 bubbles: true, 101 bubbles: true,
93 cancelable: true, 102 cancelable: true,
94 buttons: 1, 103 buttons: 1,
95 shiftKey: false, 104 shiftKey: false,
96 ctrlKey: false, 105 ctrlKey: false,
97 }; 106 };
98 107
99 if (config) { 108 if (config) {
100 for (var key in config) 109 for (var key in config)
101 props[key] = config[key]; 110 props[key] = config[key];
102 } 111 }
103 112
104 element.dispatchEvent(new MouseEvent('mousedown', props)); 113 element.dispatchEvent(new MouseEvent('mousedown', props));
105 element.dispatchEvent(new MouseEvent('mouseup', props)); 114 element.dispatchEvent(new MouseEvent('mouseup', props));
106 element.dispatchEvent(new MouseEvent('click', props)); 115 element.dispatchEvent(new MouseEvent('click', props));
107 } 116 }
OLDNEW
« no previous file with comments | « chrome/test/data/webui/md_bookmarks/reducers_test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698