| 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 * @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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 [createWindow(['http://www.google.com', 'http://example.com'])] | 161 [createWindow(['http://www.google.com', 'http://example.com'])] |
| 162 ), | 162 ), |
| 163 createSession( | 163 createSession( |
| 164 'Nexus 6', | 164 'Nexus 6', |
| 165 [ | 165 [ |
| 166 createWindow(['http://test.com']), | 166 createWindow(['http://test.com']), |
| 167 createWindow(['http://www.gmail.com', 'http://badssl.com']) | 167 createWindow(['http://www.gmail.com', 'http://badssl.com']) |
| 168 ] | 168 ] |
| 169 ), | 169 ), |
| 170 ]; | 170 ]; |
| 171 setForeignSessions(sessionList, true); | 171 setForeignSessions(sessionList); |
| 172 return PolymerTest.flushTasks(); | 172 return PolymerTest.flushTasks(); |
| 173 }).then(() => { | 173 }).then(() => { |
| 174 assertEquals(1, histogram[SyncedTabsHistogram.HAS_FOREIGN_DATA]); | 174 assertEquals(1, histogram[SyncedTabsHistogram.HAS_FOREIGN_DATA]); |
| 175 return PolymerTest.flushTasks(); | 175 return PolymerTest.flushTasks(); |
| 176 }).then(() => { | 176 }).then(() => { |
| 177 cards = polymerSelectAll( | 177 cards = polymerSelectAll( |
| 178 app.$$('#synced-devices'), 'history-synced-device-card'); | 178 app.$$('#synced-devices'), 'history-synced-device-card'); |
| 179 MockInteractions.tap(cards[0].$['card-heading']); | 179 MockInteractions.tap(cards[0].$['card-heading']); |
| 180 assertEquals(1, histogram[SyncedTabsHistogram.COLLAPSE_SESSION]); | 180 assertEquals(1, histogram[SyncedTabsHistogram.COLLAPSE_SESSION]); |
| 181 MockInteractions.tap(cards[0].$['card-heading']); | 181 MockInteractions.tap(cards[0].$['card-heading']); |
| 182 assertEquals(1, histogram[SyncedTabsHistogram.EXPAND_SESSION]); | 182 assertEquals(1, histogram[SyncedTabsHistogram.EXPAND_SESSION]); |
| 183 MockInteractions.tap(polymerSelectAll(cards[0], '.website-title')[0]); | 183 MockInteractions.tap(polymerSelectAll(cards[0], '.website-title')[0]); |
| 184 assertEquals(1, histogram[SyncedTabsHistogram.LINK_CLICKED]); | 184 assertEquals(1, histogram[SyncedTabsHistogram.LINK_CLICKED]); |
| 185 | 185 |
| 186 MockInteractions.tap(cards[0].$['menu-button']); | 186 MockInteractions.tap(cards[0].$['menu-button']); |
| 187 return PolymerTest.flushTasks(); | 187 return PolymerTest.flushTasks(); |
| 188 }).then(() => { | 188 }).then(() => { |
| 189 MockInteractions.tap(app.$$('#synced-devices').$$('#menuOpenButton')); | 189 MockInteractions.tap(app.$$('#synced-devices').$$('#menuOpenButton')); |
| 190 assertEquals(1, histogram[SyncedTabsHistogram.OPEN_ALL]); | 190 assertEquals(1, histogram[SyncedTabsHistogram.OPEN_ALL]); |
| 191 | 191 |
| 192 MockInteractions.tap(app.$$('#synced-devices').$$('#menuDeleteButton')); | 192 MockInteractions.tap(app.$$('#synced-devices').$$('#menuDeleteButton')); |
| 193 assertEquals(1, histogram[SyncedTabsHistogram.HIDE_FOR_NOW]); | 193 assertEquals(1, histogram[SyncedTabsHistogram.HIDE_FOR_NOW]); |
| 194 }); | 194 }); |
| 195 }); | 195 }); |
| 196 }); | 196 }); |
| OLD | NEW |