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 29 matching lines...) Expand all Loading... |
40 'history_synced_tabs_test.js', | 40 'history_synced_tabs_test.js', |
41 'history_toolbar_test.js', | 41 'history_toolbar_test.js', |
42 ]), | 42 ]), |
43 | 43 |
44 /** @override */ | 44 /** @override */ |
45 setUp: function() { | 45 setUp: function() { |
46 PolymerTest.prototype.setUp.call(this); | 46 PolymerTest.prototype.setUp.call(this); |
47 | 47 |
48 suiteSetup(function() { | 48 suiteSetup(function() { |
49 // Wait for the top-level app element to be upgraded. | 49 // Wait for the top-level app element to be upgraded. |
50 return waitForAppUpgrade().then(function() { | 50 return waitForAppUpgrade() |
51 $('history-app').queryState_.queryingDisabled = true; | 51 .then(function() { return md_history.ensureLazyLoaded(); }) |
52 }); | 52 .then(function() { |
| 53 $('history-app').queryState_.queryingDisabled = true; |
| 54 }); |
53 }); | 55 }); |
54 }, | 56 }, |
55 }; | 57 }; |
56 | 58 |
57 TEST_F('MaterialHistoryBrowserTest', 'BrowserServiceTest', function() { | 59 TEST_F('MaterialHistoryBrowserTest', 'BrowserServiceTest', function() { |
58 md_history.browser_service_test.registerTests(); | 60 md_history.browser_service_test.registerTests(); |
59 mocha.run(); | 61 mocha.run(); |
60 }); | 62 }); |
61 | 63 |
62 TEST_F('MaterialHistoryBrowserTest', 'DrawerTest', function() { | 64 TEST_F('MaterialHistoryBrowserTest', 'DrawerTest', function() { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 function MaterialHistoryWithQueryParamTest() {} | 132 function MaterialHistoryWithQueryParamTest() {} |
131 | 133 |
132 MaterialHistoryWithQueryParamTest.prototype = { | 134 MaterialHistoryWithQueryParamTest.prototype = { |
133 __proto__: MaterialHistoryBrowserTest.prototype, | 135 __proto__: MaterialHistoryBrowserTest.prototype, |
134 | 136 |
135 browsePreload: 'chrome://history?q=query', | 137 browsePreload: 'chrome://history?q=query', |
136 | 138 |
137 /** @override */ | 139 /** @override */ |
138 setUp: function() { | 140 setUp: function() { |
139 PolymerTest.prototype.setUp.call(this); | 141 PolymerTest.prototype.setUp.call(this); |
| 142 // This message handler needs to be registered before the test since the |
| 143 // query can happen immediately after the element is upgraded. However, |
| 144 // since there may be a delay as well, the test might check the global var |
| 145 // too early as well. In this case the test will have overtaken the |
| 146 // callback. |
| 147 registerMessageCallback('queryHistory', this, function (info) { |
| 148 window.historyQueryInfo = info; |
| 149 }); |
140 | 150 |
141 suiteSetup(function() { | 151 suiteSetup(function() { |
142 // This message handler needs to be registered before the test since the | 152 // Wait for the top-level app element to be upgraded. |
143 // query can happen immediately after the element is upgraded. However, | 153 return waitForAppUpgrade().then(function() { |
144 // since there may be a delay as well, the test might check the global var | 154 md_history.ensureLazyLoaded(); |
145 // too early as well. In this case the test will have overtaken the | |
146 // callback. | |
147 registerMessageCallback('queryHistory', this, function (info) { | |
148 window.historyQueryInfo = info; | |
149 }); | 155 }); |
150 | |
151 // Wait for the top-level app element to be upgraded. | |
152 return waitForAppUpgrade(); | |
153 }); | 156 }); |
154 }, | 157 }, |
155 }; | 158 }; |
156 | 159 |
157 TEST_F('MaterialHistoryWithQueryParamTest', 'RoutingTestWithQueryParam', | 160 TEST_F('MaterialHistoryWithQueryParamTest', 'RoutingTestWithQueryParam', |
158 function() { | 161 function() { |
159 md_history.history_routing_test_with_query_param.registerTests(); | 162 md_history.history_routing_test_with_query_param.registerTests(); |
160 mocha.run(); | 163 mocha.run(); |
161 }); | 164 }); |
OLD | NEW |