| 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 /** @fileoverview Suite of tests for the Settings basic page. */ | 5 /** @fileoverview Suite of tests for the Settings basic page. */ |
| 6 | 6 |
| 7 GEN_INCLUDE(['settings_page_browsertest.js']); | 7 GEN_INCLUDE(['settings_page_browsertest.js']); |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * @constructor | 10 * @constructor |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 /** @private {?settings.SearchRequest} */ | 49 /** @private {?settings.SearchRequest} */ |
| 50 this.searchRequest_ = null; | 50 this.searchRequest_ = null; |
| 51 } | 51 } |
| 52 | 52 |
| 53 TestSearchManager.prototype = { | 53 TestSearchManager.prototype = { |
| 54 __proto__: settings.TestBrowserProxy.prototype, | 54 __proto__: settings.TestBrowserProxy.prototype, |
| 55 | 55 |
| 56 /** @override */ | 56 /** @override */ |
| 57 search: function(text, page) { | 57 search: function(text, page) { |
| 58 if (this.searchRequest_ == null || !this.searchRequest_.isSame(text)) { | 58 if (this.searchRequest_ == null || !this.searchRequest_.isSame(text)) { |
| 59 this.searchRequest_ = new settings.SearchRequest(text); | 59 this.searchRequest_ = new settings.SearchRequest( |
| 60 text, document.createElement('div')); |
| 60 this.searchRequest_.finished = true; | 61 this.searchRequest_.finished = true; |
| 61 this.searchRequest_.updateMatches(false); | 62 this.searchRequest_.updateMatches(false); |
| 62 | 63 |
| 63 // The search much be resolved asynchronously just like the real | 64 // The search much be resolved asynchronously just like the real |
| 64 // SearchManager. Otherwise, the race condition doesn't manifest. | 65 // SearchManager. Otherwise, the race condition doesn't manifest. |
| 65 setTimeout(function() { | 66 setTimeout(function() { |
| 66 // All the sections must be hidden by the TestSearchManager, just like | 67 // All the sections must be hidden by the TestSearchManager, just like |
| 67 // the real SearchManager. Otherwise, the bug doesn't manifest. | 68 // the real SearchManager. Otherwise, the bug doesn't manifest. |
| 68 var sections = | 69 var sections = |
| 69 Polymer.dom().querySelectorAll('* /deep/ settings-section'); | 70 Polymer.dom().querySelectorAll('* /deep/ settings-section'); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 assertNotEquals(0, page.scroller.scrollTop); | 175 assertNotEquals(0, page.scroller.scrollTop); |
| 175 | 176 |
| 176 settings.navigateTo(settings.Route.ABOUT); | 177 settings.navigateTo(settings.Route.ABOUT); |
| 177 assertEquals(0, page.scroller.scrollTop); | 178 assertEquals(0, page.scroller.scrollTop); |
| 178 }); | 179 }); |
| 179 }); | 180 }); |
| 180 | 181 |
| 181 // Run all registered tests. | 182 // Run all registered tests. |
| 182 mocha.run(); | 183 mocha.run(); |
| 183 }); | 184 }); |
| OLD | NEW |