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

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

Issue 2617533003: MD Settings: change most checkboxes to toggles (leave dialogs alone) (Closed)
Patch Set: fix tests Created 3 years, 11 months 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_privacy_page', function() { 5 cr.define('settings_privacy_page', function() {
6 /** 6 /**
7 * @constructor 7 * @constructor
8 * @extends {TestBrowserProxy} 8 * @extends {TestBrowserProxy}
9 * @implements {settings.ClearBrowsingDataBrowserProxy} 9 * @implements {settings.ClearBrowsingDataBrowserProxy}
10 */ 10 */
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 page = document.createElement('settings-privacy-page'); 253 page = document.createElement('settings-privacy-page');
254 }); 254 });
255 255
256 teardown(function() { page.remove(); }); 256 teardown(function() { page.remove(); });
257 257
258 test('test whether extended reporting is enabled/managed', function() { 258 test('test whether extended reporting is enabled/managed', function() {
259 return testBrowserProxy.whenCalled( 259 return testBrowserProxy.whenCalled(
260 'getSafeBrowsingExtendedReporting').then(function() { 260 'getSafeBrowsingExtendedReporting').then(function() {
261 Polymer.dom.flush(); 261 Polymer.dom.flush();
262 262
263 // Checkbox starts checked by default 263 // Control starts checked by default
264 var checkbox = page.$.safeBrowsingExtendedReportingCheckbox; 264 var control = page.$.safeBrowsingExtendedReportingControl;
265 assertEquals(true, checkbox.checked); 265 assertEquals(true, control.checked);
266 266
267 // Notification from browser can uncheck the box 267 // Notification from browser can uncheck the box
268 cr.webUIListenerCallback('safe-browsing-extended-reporting-change', 268 cr.webUIListenerCallback('safe-browsing-extended-reporting-change',
269 false); 269 false);
270 Polymer.dom.flush(); 270 Polymer.dom.flush();
271 assertEquals(false, checkbox.checked); 271 assertEquals(false, control.checked);
272 272
273 // Tapping on the box will check it again. 273 // Tapping on the box will check it again.
274 MockInteractions.tap(checkbox); 274 MockInteractions.tap(control);
275 return testBrowserProxy.whenCalled('getSafeBrowsingExtendedReporting', 275 return testBrowserProxy.whenCalled('getSafeBrowsingExtendedReporting',
276 true); 276 true);
277 }); 277 });
278 }); 278 });
279 }); 279 });
280 } 280 }
281 281
282 return { 282 return {
283 registerTests: function() { 283 registerTests: function() {
284 if (cr.isMac || cr.isWin) 284 if (cr.isMac || cr.isWin)
285 registerNativeCertificateManagerTests(); 285 registerNativeCertificateManagerTests();
286 286
287 registerClearBrowsingDataTests(); 287 registerClearBrowsingDataTests();
288 registerPrivacyPageTests(); 288 registerPrivacyPageTests();
289 registerSafeBrowsingExtendedReportingTests(); 289 registerSafeBrowsingExtendedReportingTests();
290 }, 290 },
291 }; 291 };
292 }); 292 });
OLDNEW
« no previous file with comments | « chrome/test/data/webui/settings/people_page_sync_page_test.js ('k') | chrome/test/data/webui/settings/search_page_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698