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

Unified Diff: chrome/test/data/webui/md_history/md_history_browsertest.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/md_history_browsertest.js
diff --git a/chrome/test/data/webui/md_history/md_history_browsertest.js b/chrome/test/data/webui/md_history/md_history_browsertest.js
index e3caca0eb185f845eb31cba2b742fcf18cdd3c9f..3f11185a3f0796976ab0ce37b69c5a560ad0b162 100644
--- a/chrome/test/data/webui/md_history/md_history_browsertest.js
+++ b/chrome/test/data/webui/md_history/md_history_browsertest.js
@@ -33,6 +33,7 @@ MaterialHistoryBrowserTest.prototype = {
'history_grouped_list_test.js',
'history_item_test.js',
'history_list_test.js',
+ 'history_metrics_test.js',
'history_overflow_menu_test.js',
'history_routing_test.js',
'history_supervised_user_test.js',
@@ -40,11 +41,26 @@ MaterialHistoryBrowserTest.prototype = {
'history_toolbar_test.js'
]),
+ registerHistogramCallback_: function() {
tsergeant 2016/08/15 07:05:18 I'm not a big fan of this: Firstly, can it be loc
calamity 2016/08/17 03:15:29 Changed this as discussed
+ window.histogramMap = {};
+ registerMessageCallback(
+ 'metricsHandler:recordInHistogram', this, function(args) {
+ if (!(args[0] in window.histogramMap))
+ window.histogramMap[args[0]] = {};
+
+ if (!(args[1] in window.histogramMap[args[0]]))
+ window.histogramMap[args[0]][args[1]] = 0;
+
+ window.histogramMap[args[0]][args[1]]++;
+ });
+ },
+
/** @override */
setUp: function() {
PolymerTest.prototype.setUp.call(this);
suiteSetup(function() {
+ this.registerHistogramCallback_();
// Wait for the top-level app element to be upgraded.
return waitForAppUpgrade().then(function() {
$('history-app').queryState_.queryingDisabled = true;
@@ -55,8 +71,9 @@ MaterialHistoryBrowserTest.prototype = {
.$.toolbar.$['main-toolbar']
.getSearchField()
.isSearchFocused());
+
});
- });
+ }.bind(this));
},
};
@@ -85,6 +102,11 @@ TEST_F('MaterialHistoryBrowserTest', 'HistoryListTest', function() {
mocha.run();
});
+TEST_F('MaterialHistoryBrowserTest', 'HistoryMetricsTest', function() {
+ md_history.history_metrics_test.registerTests();
+ mocha.run();
+});
+
TEST_F('MaterialHistoryBrowserTest', 'HistoryToolbarTest', function() {
md_history.history_toolbar_test.registerTests();
mocha.run();

Powered by Google App Engine
This is Rietveld 408576698