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

Side by Side Diff: chrome/test/data/webui/md_history/history_metrics_test.js

Issue 2583353003: MD History: Replace last usage of cr-shared-menu with cr-action-menu. (Closed)
Patch Set: Test found real subtle bug (display flex overriding [hidden] attribute) Created 3 years, 12 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
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 * @constructor 6 * @constructor
7 * @extends {md_history.BrowserService} 7 * @extends {md_history.BrowserService}
8 */ 8 */
9 var TestMetricsBrowserService = function() { 9 var TestMetricsBrowserService = function() {
10 this.histogramMap = {}; 10 this.histogramMap = {};
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 return PolymerTest.flushTasks(); 144 return PolymerTest.flushTasks();
145 }).then(() => { 145 }).then(() => {
146 assertEquals(1, histogramMap['HistoryPage.RemoveEntryPosition'][0]); 146 assertEquals(1, histogramMap['HistoryPage.RemoveEntryPosition'][0]);
147 assertEquals(1, histogramMap['HistoryPage.RemoveEntryPositionSubset'][0]); 147 assertEquals(1, histogramMap['HistoryPage.RemoveEntryPositionSubset'][0]);
148 }); 148 });
149 }); 149 });
150 150
151 test('synced-device-manager', function() { 151 test('synced-device-manager', function() {
152 app.selectedPage_ = 'syncedTabs'; 152 app.selectedPage_ = 'syncedTabs';
153 var histogram; 153 var histogram;
154 var menuButton;
154 return PolymerTest.flushTasks().then(() => { 155 return PolymerTest.flushTasks().then(() => {
155 histogram = histogramMap[SYNCED_TABS_HISTOGRAM_NAME]; 156 histogram = histogramMap[SYNCED_TABS_HISTOGRAM_NAME];
156 assertEquals(1, histogram[SyncedTabsHistogram.INITIALIZED]); 157 assertEquals(1, histogram[SyncedTabsHistogram.INITIALIZED]);
157 158
158 var sessionList = [ 159 var sessionList = [
159 createSession( 160 createSession(
160 'Nexus 5', 161 'Nexus 5',
161 [createWindow(['http://www.google.com', 'http://example.com'])] 162 [createWindow(['http://www.google.com', 'http://example.com'])]
162 ), 163 ),
163 createSession( 164 createSession(
(...skipping 12 matching lines...) Expand all
176 }).then(() => { 177 }).then(() => {
177 cards = polymerSelectAll( 178 cards = polymerSelectAll(
178 app.$$('#synced-devices'), 'history-synced-device-card'); 179 app.$$('#synced-devices'), 'history-synced-device-card');
179 MockInteractions.tap(cards[0].$['card-heading']); 180 MockInteractions.tap(cards[0].$['card-heading']);
180 assertEquals(1, histogram[SyncedTabsHistogram.COLLAPSE_SESSION]); 181 assertEquals(1, histogram[SyncedTabsHistogram.COLLAPSE_SESSION]);
181 MockInteractions.tap(cards[0].$['card-heading']); 182 MockInteractions.tap(cards[0].$['card-heading']);
182 assertEquals(1, histogram[SyncedTabsHistogram.EXPAND_SESSION]); 183 assertEquals(1, histogram[SyncedTabsHistogram.EXPAND_SESSION]);
183 MockInteractions.tap(polymerSelectAll(cards[0], '.website-title')[0]); 184 MockInteractions.tap(polymerSelectAll(cards[0], '.website-title')[0]);
184 assertEquals(1, histogram[SyncedTabsHistogram.LINK_CLICKED]); 185 assertEquals(1, histogram[SyncedTabsHistogram.LINK_CLICKED]);
185 186
186 MockInteractions.tap(cards[0].$['menu-button']); 187 menuButton = cards[0].$['menu-button'];
188 MockInteractions.tap(menuButton);
187 return PolymerTest.flushTasks(); 189 return PolymerTest.flushTasks();
188 }).then(() => { 190 }).then(() => {
189 MockInteractions.tap(app.$$('#synced-devices').$$('#menuOpenButton')); 191 MockInteractions.tap(app.$$('#synced-devices').$$('#menuOpenButton'));
190 assertEquals(1, histogram[SyncedTabsHistogram.OPEN_ALL]); 192 assertEquals(1, histogram[SyncedTabsHistogram.OPEN_ALL]);
191 193
194 MockInteractions.tap(menuButton);
195 return PolymerTest.flushTasks();
196 }).then(() => {
192 MockInteractions.tap(app.$$('#synced-devices').$$('#menuDeleteButton')); 197 MockInteractions.tap(app.$$('#synced-devices').$$('#menuDeleteButton'));
193 assertEquals(1, histogram[SyncedTabsHistogram.HIDE_FOR_NOW]); 198 assertEquals(1, histogram[SyncedTabsHistogram.HIDE_FOR_NOW]);
194 }); 199 });
195 }); 200 });
196 }); 201 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698