| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 layout. */ | 5 /** @fileoverview Suite of tests for the Settings layout. */ |
| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 toolbar.getSearchField()); | 118 toolbar.getSearchField()); |
| 119 | 119 |
| 120 var query = 'foo'; | 120 var query = 'foo'; |
| 121 settings.navigateTo( | 121 settings.navigateTo( |
| 122 settings.Route.BASIC, new URLSearchParams(`search=${query}`)); | 122 settings.Route.BASIC, new URLSearchParams(`search=${query}`)); |
| 123 assertEquals(query, searchField.getSearchInput().bindValue); | 123 assertEquals(query, searchField.getSearchInput().bindValue); |
| 124 | 124 |
| 125 settings.navigateTo(settings.Route.BASIC); | 125 settings.navigateTo(settings.Route.BASIC); |
| 126 assertEquals('', searchField.getSearchInput().bindValue); | 126 assertEquals('', searchField.getSearchInput().bindValue); |
| 127 }); | 127 }); |
| 128 |
| 129 test('whitespace only search query is ignored', function() { |
| 130 toolbar = /** @type {!CrToolbarElement} */ (ui.$$('cr-toolbar')); |
| 131 var searchField = /** @type {CrToolbarSearchFieldElement} */ ( |
| 132 toolbar.getSearchField()); |
| 133 searchField.setValue(' '); |
| 134 |
| 135 var urlParams = settings.getQueryParameters(); |
| 136 assertFalse(urlParams.has('search')); |
| 137 }); |
| 128 }); | 138 }); |
| 129 | 139 |
| 130 mocha.run(); | 140 mocha.run(); |
| 131 }); | 141 }); |
| OLD | NEW |