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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/webui/md_history/history_metrics_test.js
diff --git a/chrome/test/data/webui/md_history/history_metrics_test.js b/chrome/test/data/webui/md_history/history_metrics_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..051e686d87a490a1a9ab0e12c09eef68f4b43c7a
--- /dev/null
+++ b/chrome/test/data/webui/md_history/history_metrics_test.js
@@ -0,0 +1,41 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+cr.define('md_history.history_metrics_test', function() {
+ function registerTests() {
+ suite('Metrics', function() {
+ test('History.HistoryView', function() {
+ var app = $('history-app');
+ app.grouped_ = true;
+
+ var histogram = window.histogramMap['History.HistoryView'];
+ assertEquals(1, histogram[HistoryViewHistogram.HISTORY]);
+
+ app.selectedPage_ = 'syncedTabs';
+ return waitForAnimationFrame().then(() => {
+ assertEquals(1, histogram[HistoryViewHistogram.SIGNIN_PROMO]);
+ updateSignInState(true);
+ 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
+ }).then(() => {
+ assertEquals(1, histogram[HistoryViewHistogram.SYNCED_TABS]);
+ app.selectedPage_ = 'history';
+ return waitForAnimationFrame();
+ }).then(() => {
+ assertEquals(2, histogram[HistoryViewHistogram.HISTORY]);
+ app.set('queryState_.range', HistoryRange.WEEK);
+ return waitForAnimationFrame();
+ }).then(() => {
+ assertEquals(1, histogram[HistoryViewHistogram.GROUPED_WEEK]);
+ app.set('queryState_.range', HistoryRange.MONTH);
+ return waitForAnimationFrame();
+ }).then(() => {
+ assertEquals(1, histogram[HistoryViewHistogram.GROUPED_MONTH]);
+ });
+ });
+ });
+ }
+ return {
+ registerTests: registerTests
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698