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

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

Issue 2238163002: [MD History] Add UMA stats for switching views and the CBD button. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@start_focus_in_search_bar
Patch Set: add test, add grouped history Created 4 years, 4 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
(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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698