Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Side by Side Diff: chrome/test/data/webui/settings/search_page_test.js

Issue 2572963004: MD Settings: Add "Show Google Now cards in the launcher" row in Search section. (Closed)
Patch Set: Rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 cr.define('settings_search_page', function() { 5 cr.define('settings_search_page', function() {
6 function generateSearchEngineInfo() { 6 function generateSearchEngineInfo() {
7 var searchEngines0 = settings_search.createSampleSearchEngine( 7 var searchEngines0 = settings_search.createSampleSearchEngine(
8 true, false, false); 8 true, false, false);
9 searchEngines0.default = true; 9 searchEngines0.default = true;
10 var searchEngines1 = settings_search.createSampleSearchEngine( 10 var searchEngines1 = settings_search.createSampleSearchEngine(
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 assertTrue(!!checkbox); 141 assertTrue(!!checkbox);
142 assertFalse(checkbox.disabled); 142 assertFalse(checkbox.disabled);
143 assertFalse(checkbox.checked); 143 assertFalse(checkbox.checked);
144 MockInteractions.tap(checkbox.$.checkbox); 144 MockInteractions.tap(checkbox.$.checkbox);
145 Polymer.dom.flush(); 145 Polymer.dom.flush();
146 return browserProxy.whenCalled('setHotwordSearchEnabled'); 146 return browserProxy.whenCalled('setHotwordSearchEnabled');
147 }).then(function() { 147 }).then(function() {
148 assertTrue(browserProxy.hotwordSearchEnabled); 148 assertTrue(browserProxy.hotwordSearchEnabled);
149 }); 149 });
150 }); 150 });
151
152 test('UpdateGoogleNowOnPrefChange', function() {
153 return browserProxy.whenCalled('getGoogleNowAvailability').then(
154 function() {
155 Polymer.dom.flush();
156 assertTrue(page.googleNowAvailable_);
157
158 var checkbox = page.$$('#googleNowEnable');
159 assertTrue(!!checkbox);
160 assertFalse(checkbox.disabled);
161 assertFalse(checkbox.checked);
162
163 page.prefs = {
164 google_now_launcher: {
165 enabled: {
166 type: chrome.settingsPrivate.PrefType.BOOLEAN,
167 value: true,
168 }
169 }
170 };
171 Polymer.dom.flush();
172 assertFalse(checkbox.disabled);
173 assertTrue(checkbox.checked);
174 });
175 });
151 }); 176 });
152 } 177 }
153 178
154 return { 179 return {
155 registerTests: registerTests, 180 registerTests: registerTests,
156 }; 181 };
157 }); 182 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698