Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Test suite for the Material Design history page. | 6 * @fileoverview Test suite for the Material Design history page. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 var ROOT_PATH = '../../../../../'; | 9 var ROOT_PATH = '../../../../../'; |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 /** @override */ | 26 /** @override */ |
| 27 runAccessibilityChecks: false, | 27 runAccessibilityChecks: false, |
| 28 | 28 |
| 29 extraLibraries: PolymerTest.getLibraries(ROOT_PATH).concat([ | 29 extraLibraries: PolymerTest.getLibraries(ROOT_PATH).concat([ |
| 30 'test_util.js', | 30 'test_util.js', |
| 31 'browser_service_test.js', | 31 'browser_service_test.js', |
| 32 'history_drawer_test.js', | 32 'history_drawer_test.js', |
| 33 'history_grouped_list_test.js', | 33 'history_grouped_list_test.js', |
| 34 'history_item_test.js', | 34 'history_item_test.js', |
| 35 'history_list_test.js', | 35 'history_list_test.js', |
| 36 'history_metrics_test.js', | |
| 36 'history_overflow_menu_test.js', | 37 'history_overflow_menu_test.js', |
| 37 'history_routing_test.js', | 38 'history_routing_test.js', |
| 38 'history_supervised_user_test.js', | 39 'history_supervised_user_test.js', |
| 39 'history_synced_tabs_test.js', | 40 'history_synced_tabs_test.js', |
| 40 'history_toolbar_test.js' | 41 'history_toolbar_test.js' |
| 41 ]), | 42 ]), |
| 42 | 43 |
| 44 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
| |
| 45 window.histogramMap = {}; | |
| 46 registerMessageCallback( | |
| 47 'metricsHandler:recordInHistogram', this, function(args) { | |
| 48 if (!(args[0] in window.histogramMap)) | |
| 49 window.histogramMap[args[0]] = {}; | |
| 50 | |
| 51 if (!(args[1] in window.histogramMap[args[0]])) | |
| 52 window.histogramMap[args[0]][args[1]] = 0; | |
| 53 | |
| 54 window.histogramMap[args[0]][args[1]]++; | |
| 55 }); | |
| 56 }, | |
| 57 | |
| 43 /** @override */ | 58 /** @override */ |
| 44 setUp: function() { | 59 setUp: function() { |
| 45 PolymerTest.prototype.setUp.call(this); | 60 PolymerTest.prototype.setUp.call(this); |
| 46 | 61 |
| 47 suiteSetup(function() { | 62 suiteSetup(function() { |
| 63 this.registerHistogramCallback_(); | |
| 48 // Wait for the top-level app element to be upgraded. | 64 // Wait for the top-level app element to be upgraded. |
| 49 return waitForAppUpgrade().then(function() { | 65 return waitForAppUpgrade().then(function() { |
| 50 $('history-app').queryState_.queryingDisabled = true; | 66 $('history-app').queryState_.queryingDisabled = true; |
| 51 | 67 |
| 52 // Ensure the search bar is focused on load. | 68 // Ensure the search bar is focused on load. |
| 53 assertTrue( | 69 assertTrue( |
| 54 $('history-app') | 70 $('history-app') |
| 55 .$.toolbar.$['main-toolbar'] | 71 .$.toolbar.$['main-toolbar'] |
| 56 .getSearchField() | 72 .getSearchField() |
| 57 .isSearchFocused()); | 73 .isSearchFocused()); |
| 74 | |
| 58 }); | 75 }); |
| 59 }); | 76 }.bind(this)); |
| 60 }, | 77 }, |
| 61 }; | 78 }; |
| 62 | 79 |
| 63 TEST_F('MaterialHistoryBrowserTest', 'BrowserServiceTest', function() { | 80 TEST_F('MaterialHistoryBrowserTest', 'BrowserServiceTest', function() { |
| 64 md_history.browser_service_test.registerTests(); | 81 md_history.browser_service_test.registerTests(); |
| 65 mocha.run(); | 82 mocha.run(); |
| 66 }); | 83 }); |
| 67 | 84 |
| 68 TEST_F('MaterialHistoryBrowserTest', 'DrawerTest', function() { | 85 TEST_F('MaterialHistoryBrowserTest', 'DrawerTest', function() { |
| 69 md_history.history_drawer_test.registerTests(); | 86 md_history.history_drawer_test.registerTests(); |
| 70 mocha.run(); | 87 mocha.run(); |
| 71 }); | 88 }); |
| 72 | 89 |
| 73 TEST_F('MaterialHistoryBrowserTest', 'HistoryGroupedListTest', function() { | 90 TEST_F('MaterialHistoryBrowserTest', 'HistoryGroupedListTest', function() { |
| 74 md_history.history_grouped_list_test.registerTests(); | 91 md_history.history_grouped_list_test.registerTests(); |
| 75 mocha.run(); | 92 mocha.run(); |
| 76 }); | 93 }); |
| 77 | 94 |
| 78 TEST_F('MaterialHistoryBrowserTest', 'HistoryItemTest', function() { | 95 TEST_F('MaterialHistoryBrowserTest', 'HistoryItemTest', function() { |
| 79 md_history.history_item_test.registerTests(); | 96 md_history.history_item_test.registerTests(); |
| 80 mocha.run(); | 97 mocha.run(); |
| 81 }); | 98 }); |
| 82 | 99 |
| 83 TEST_F('MaterialHistoryBrowserTest', 'HistoryListTest', function() { | 100 TEST_F('MaterialHistoryBrowserTest', 'HistoryListTest', function() { |
| 84 md_history.history_list_test.registerTests(); | 101 md_history.history_list_test.registerTests(); |
| 85 mocha.run(); | 102 mocha.run(); |
| 86 }); | 103 }); |
| 87 | 104 |
| 105 TEST_F('MaterialHistoryBrowserTest', 'HistoryMetricsTest', function() { | |
| 106 md_history.history_metrics_test.registerTests(); | |
| 107 mocha.run(); | |
| 108 }); | |
| 109 | |
| 88 TEST_F('MaterialHistoryBrowserTest', 'HistoryToolbarTest', function() { | 110 TEST_F('MaterialHistoryBrowserTest', 'HistoryToolbarTest', function() { |
| 89 md_history.history_toolbar_test.registerTests(); | 111 md_history.history_toolbar_test.registerTests(); |
| 90 mocha.run(); | 112 mocha.run(); |
| 91 }); | 113 }); |
| 92 | 114 |
| 93 TEST_F('MaterialHistoryBrowserTest', 'HistoryOverflowMenuTest', function() { | 115 TEST_F('MaterialHistoryBrowserTest', 'HistoryOverflowMenuTest', function() { |
| 94 md_history.history_overflow_menu_test.registerTests(); | 116 md_history.history_overflow_menu_test.registerTests(); |
| 95 mocha.run(); | 117 mocha.run(); |
| 96 }); | 118 }); |
| 97 | 119 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 return waitForAppUpgrade(); | 170 return waitForAppUpgrade(); |
| 149 }); | 171 }); |
| 150 }, | 172 }, |
| 151 }; | 173 }; |
| 152 | 174 |
| 153 TEST_F('MaterialHistoryWithQueryParamTest', 'RoutingTestWithQueryParam', | 175 TEST_F('MaterialHistoryWithQueryParamTest', 'RoutingTestWithQueryParam', |
| 154 function() { | 176 function() { |
| 155 md_history.history_routing_test_with_query_param.registerTests(); | 177 md_history.history_routing_test_with_query_param.registerTests(); |
| 156 mocha.run(); | 178 mocha.run(); |
| 157 }); | 179 }); |
| OLD | NEW |