Chromium Code Reviews| 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(); |