| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 assertTrue(menu.advancedOpened); | 104 assertTrue(menu.advancedOpened); |
| 105 | 105 |
| 106 MockInteractions.tap(menu.$$('#advancedPage .menu-trigger')); | 106 MockInteractions.tap(menu.$$('#advancedPage .menu-trigger')); |
| 107 Polymer.dom.flush(); | 107 Polymer.dom.flush(); |
| 108 | 108 |
| 109 // Check that all values are updated in unison. | 109 // Check that all values are updated in unison. |
| 110 assertFalse(menu.advancedOpened); | 110 assertFalse(menu.advancedOpened); |
| 111 assertFalse(ui.advancedOpened_); | 111 assertFalse(ui.advancedOpened_); |
| 112 assertFalse(main.advancedToggleExpanded); | 112 assertFalse(main.advancedToggleExpanded); |
| 113 }); | 113 }); |
| 114 |
| 115 test('URL initiated search propagates to search box', function() { |
| 116 toolbar = /** @type {!CrToolbarElement} */ (ui.$$('cr-toolbar')); |
| 117 var searchField = /** @type {CrToolbarSearchFieldElement} */ ( |
| 118 toolbar.getSearchField()); |
| 119 |
| 120 var query = 'foo'; |
| 121 settings.navigateTo( |
| 122 settings.Route.BASIC, new URLSearchParams(`search=${query}`)); |
| 123 assertEquals(query, searchField.getSearchInput().bindValue); |
| 124 |
| 125 settings.navigateTo(settings.Route.BASIC); |
| 126 assertEquals('', searchField.getSearchInput().bindValue); |
| 127 }); |
| 128 |
| 129 test('search box initiated search propagates to URL', function() { |
| 130 assertFalse(settings.getQueryParameters().has('search')); |
| 131 var searchField = /** @type {CrToolbarSearchFieldElement} */ ( |
| 132 toolbar.getSearchField()); |
| 133 var value = 'GOOG'; |
| 134 searchField.setValue(value); |
| 135 assertEquals(value, settings.getQueryParameters().get('search')); |
| 136 }); |
| 114 }); | 137 }); |
| 115 | 138 |
| 116 mocha.run(); | 139 mocha.run(); |
| 117 }); | 140 }); |
| OLD | NEW |