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

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

Issue 2623033003: Always show counters in the material design Clear Browsing Data dialog. (Closed)
Patch Set: iOS fix #2 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 221 }
222 }); 222 });
223 var checkbox = element.$$('settings-checkbox'); 223 var checkbox = element.$$('settings-checkbox');
224 assertEquals('browser.clear_data.browsing_history', checkbox.pref.key); 224 assertEquals('browser.clear_data.browsing_history', checkbox.pref.key);
225 225
226 // Simulate a browsing data counter result for history. This checkbox's 226 // Simulate a browsing data counter result for history. This checkbox's
227 // sublabel should be updated. 227 // sublabel should be updated.
228 cr.webUIListenerCallback( 228 cr.webUIListenerCallback(
229 'update-counter-text', checkbox.pref.key, 'result'); 229 'update-counter-text', checkbox.pref.key, 'result');
230 assertEquals('result', checkbox.subLabel); 230 assertEquals('result', checkbox.subLabel);
231
232 // Unchecking the checkbox will hide its sublabel.
233 var subLabelStyle = window.getComputedStyle(checkbox.$$('.secondary'));
234 assertNotEquals('none', subLabelStyle.display);
235 checkbox.checked = false;
236 assertEquals('none', subLabelStyle.display);
237 }); 231 });
238 }); 232 });
239 } 233 }
240 234
241 function registerSafeBrowsingExtendedReportingTests() { 235 function registerSafeBrowsingExtendedReportingTests() {
242 suite('SafeBrowsingExtendedReporting', function() { 236 suite('SafeBrowsingExtendedReporting', function() {
243 /** @type {settings.TestPrivacyPageBrowserProxy} */ 237 /** @type {settings.TestPrivacyPageBrowserProxy} */
244 var testBrowserProxy; 238 var testBrowserProxy;
245 239
246 /** @type {SettingsPrivacyPageElement} */ 240 /** @type {SettingsPrivacyPageElement} */
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 registerTests: function() { 277 registerTests: function() {
284 if (cr.isMac || cr.isWin) 278 if (cr.isMac || cr.isWin)
285 registerNativeCertificateManagerTests(); 279 registerNativeCertificateManagerTests();
286 280
287 registerClearBrowsingDataTests(); 281 registerClearBrowsingDataTests();
288 registerPrivacyPageTests(); 282 registerPrivacyPageTests();
289 registerSafeBrowsingExtendedReportingTests(); 283 registerSafeBrowsingExtendedReportingTests();
290 }, 284 },
291 }; 285 };
292 }); 286 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698