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

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

Issue 2855123004: MD Settings: hide browsing history-related rows for supervised users (Closed)
Patch Set: comment Created 3 years, 7 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
« no previous file with comments | « chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }); 231 });
232
233 test('history rows are hidden for supervised users', function() {
234 assertFalse(loadTimeData.getBoolean('isSupervised'));
235 assertFalse(element.$.browsingCheckbox.hidden);
236 assertFalse(element.$.downloadCheckbox.hidden);
237
238 element.remove();
239 testBrowserProxy.reset();
240 loadTimeData.overrideValues({isSupervised: true});
241
242 element = document.createElement('settings-clear-browsing-data-dialog');
243 document.body.appendChild(element);
244 Polymer.dom.flush();
245
246 return testBrowserProxy.whenCalled('initialize').then(function() {
247 assertTrue(element.$.browsingCheckbox.hidden);
248 assertTrue(element.$.downloadCheckbox.hidden);
249 });
250 });
232 }); 251 });
233 } 252 }
234 253
235 function registerSafeBrowsingExtendedReportingTests() { 254 function registerSafeBrowsingExtendedReportingTests() {
236 suite('SafeBrowsingExtendedReporting', function() { 255 suite('SafeBrowsingExtendedReporting', function() {
237 /** @type {settings.TestPrivacyPageBrowserProxy} */ 256 /** @type {settings.TestPrivacyPageBrowserProxy} */
238 var testBrowserProxy; 257 var testBrowserProxy;
239 258
240 /** @type {SettingsPrivacyPageElement} */ 259 /** @type {SettingsPrivacyPageElement} */
241 var page; 260 var page;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 registerTests: function() { 296 registerTests: function() {
278 if (cr.isMac || cr.isWin) 297 if (cr.isMac || cr.isWin)
279 registerNativeCertificateManagerTests(); 298 registerNativeCertificateManagerTests();
280 299
281 registerClearBrowsingDataTests(); 300 registerClearBrowsingDataTests();
282 registerPrivacyPageTests(); 301 registerPrivacyPageTests();
283 registerSafeBrowsingExtendedReportingTests(); 302 registerSafeBrowsingExtendedReportingTests();
284 }, 303 },
285 }; 304 };
286 }); 305 });
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698