Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 cr.define('md_history.history_metrics_test', function() { | |
| 6 function registerTests() { | |
| 7 suite('Metrics', function() { | |
| 8 test('History.HistoryView', function() { | |
| 9 var app = $('history-app'); | |
| 10 app.grouped_ = true; | |
| 11 | |
| 12 var histogram = window.histogramMap['History.HistoryView']; | |
| 13 assertEquals(1, histogram[HistoryViewHistogram.HISTORY]); | |
| 14 | |
| 15 app.selectedPage_ = 'syncedTabs'; | |
| 16 return waitForAnimationFrame().then(() => { | |
| 17 assertEquals(1, histogram[HistoryViewHistogram.SIGNIN_PROMO]); | |
| 18 updateSignInState(true); | |
| 19 return waitForAnimationFrame(); | |
|
tsergeant
2016/08/15 07:05:18
waitForAnimationFrame is very specific. Does flush
calamity
2016/08/17 03:15:29
flush() doesn't seem to work. Since HistoryView is
| |
| 20 }).then(() => { | |
| 21 assertEquals(1, histogram[HistoryViewHistogram.SYNCED_TABS]); | |
| 22 app.selectedPage_ = 'history'; | |
| 23 return waitForAnimationFrame(); | |
| 24 }).then(() => { | |
| 25 assertEquals(2, histogram[HistoryViewHistogram.HISTORY]); | |
| 26 app.set('queryState_.range', HistoryRange.WEEK); | |
| 27 return waitForAnimationFrame(); | |
| 28 }).then(() => { | |
| 29 assertEquals(1, histogram[HistoryViewHistogram.GROUPED_WEEK]); | |
| 30 app.set('queryState_.range', HistoryRange.MONTH); | |
| 31 return waitForAnimationFrame(); | |
| 32 }).then(() => { | |
| 33 assertEquals(1, histogram[HistoryViewHistogram.GROUPED_MONTH]); | |
| 34 }); | |
| 35 }); | |
| 36 }); | |
| 37 } | |
| 38 return { | |
| 39 registerTests: registerTests | |
| 40 }; | |
| 41 }); | |
| OLD | NEW |