| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 var histogram = histogramMap['History.HistoryPageView']; | 69 var histogram = histogramMap['History.HistoryPageView']; |
| 70 assertEquals(1, histogram[HistoryPageViewHistogram.HISTORY]); | 70 assertEquals(1, histogram[HistoryPageViewHistogram.HISTORY]); |
| 71 | 71 |
| 72 app.selectedPage_ = 'syncedTabs'; | 72 app.selectedPage_ = 'syncedTabs'; |
| 73 assertEquals(1, histogram[HistoryPageViewHistogram.SIGNIN_PROMO]); | 73 assertEquals(1, histogram[HistoryPageViewHistogram.SIGNIN_PROMO]); |
| 74 updateSignInState(true); | 74 updateSignInState(true); |
| 75 return PolymerTest.flushTasks().then(() => { | 75 return PolymerTest.flushTasks().then(() => { |
| 76 assertEquals(1, histogram[HistoryPageViewHistogram.SYNCED_TABS]); | 76 assertEquals(1, histogram[HistoryPageViewHistogram.SYNCED_TABS]); |
| 77 app.selectedPage_ = 'history'; | 77 app.selectedPage_ = 'history'; |
| 78 assertEquals(2, histogram[HistoryPageViewHistogram.HISTORY]); | 78 assertEquals(2, histogram[HistoryPageViewHistogram.HISTORY]); |
| 79 app.fire('change-query', {range: HistoryRange.WEEK}); | |
| 80 assertEquals(1, histogram[HistoryPageViewHistogram.GROUPED_WEEK]); | |
| 81 app.fire('change-query', {range: HistoryRange.MONTH}); | |
| 82 assertEquals(1, histogram[HistoryPageViewHistogram.GROUPED_MONTH]); | |
| 83 }); | 79 }); |
| 84 }); | 80 }); |
| 85 | 81 |
| 86 test('history-list', function() { | 82 test('history-list', function() { |
| 87 var historyEntry = | 83 var historyEntry = |
| 88 createHistoryEntry('2015-01-01', 'http://www.google.com'); | 84 createHistoryEntry('2015-01-01', 'http://www.google.com'); |
| 89 historyEntry.starred = true; | 85 historyEntry.starred = true; |
| 90 app.historyResult(createHistoryInfo(), [ | 86 app.historyResult(createHistoryInfo(), [ |
| 91 createHistoryEntry('2015-01-01', 'http://www.example.com'), | 87 createHistoryEntry('2015-01-01', 'http://www.example.com'), |
| 92 historyEntry | 88 historyEntry |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 assertEquals(1, histogram[SyncedTabsHistogram.OPEN_ALL]); | 188 assertEquals(1, histogram[SyncedTabsHistogram.OPEN_ALL]); |
| 193 | 189 |
| 194 MockInteractions.tap(menuButton); | 190 MockInteractions.tap(menuButton); |
| 195 return PolymerTest.flushTasks(); | 191 return PolymerTest.flushTasks(); |
| 196 }).then(() => { | 192 }).then(() => { |
| 197 MockInteractions.tap(app.$$('#synced-devices').$$('#menuDeleteButton')); | 193 MockInteractions.tap(app.$$('#synced-devices').$$('#menuDeleteButton')); |
| 198 assertEquals(1, histogram[SyncedTabsHistogram.HIDE_FOR_NOW]); | 194 assertEquals(1, histogram[SyncedTabsHistogram.HIDE_FOR_NOW]); |
| 199 }); | 195 }); |
| 200 }); | 196 }); |
| 201 }); | 197 }); |
| OLD | NEW |