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

Unified 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: closure fix Created 3 years, 8 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/settings/privacy_page_test.js
diff --git a/chrome/test/data/webui/settings/privacy_page_test.js b/chrome/test/data/webui/settings/privacy_page_test.js
index 0488099c61caf12b4cc1e8dd97dfd7fcc128c55a..2c2d24537385e730b55d6c4c7190d7d0f27da396 100644
--- a/chrome/test/data/webui/settings/privacy_page_test.js
+++ b/chrome/test/data/webui/settings/privacy_page_test.js
@@ -12,6 +12,7 @@ cr.define('settings_privacy_page', function() {
settings.TestBrowserProxy.call(this, [
'initialize',
'clearBrowsingData',
+ 'shouldShowBrowsingHistoryRows',
]);
/**
@@ -21,6 +22,9 @@ cr.define('settings_privacy_page', function() {
* @private {?Promise}
*/
this.clearBrowsingDataPromise_ = null;
+
+ /** @private */
+ this.shouldShowBrowsingHistoryRows_ = true;
}
TestClearBrowsingDataBrowserProxy.prototype = {
@@ -31,6 +35,11 @@ cr.define('settings_privacy_page', function() {
this.clearBrowsingDataPromise_ = promise;
},
+ /** @param {boolean} shouldShow */
+ setShouldShowBrowsingHistoryRows: function(shouldShow) {
+ this.shouldShowBrowsingHistoryRows_ = shouldShow;
+ },
+
/** @override */
clearBrowsingData: function() {
this.methodCalled('clearBrowsingData');
@@ -44,6 +53,11 @@ cr.define('settings_privacy_page', function() {
this.methodCalled('initialize');
return Promise.resolve(false);
},
+
+ /** @override */
+ shouldShowBrowsingHistoryRows: function() {
+ return this.shouldShowBrowsingHistoryRows_;
+ },
};
function registerNativeCertificateManagerTests() {
@@ -229,6 +243,24 @@ cr.define('settings_privacy_page', function() {
'update-counter-text', checkbox.pref.key, 'result');
assertEquals('result', checkbox.subLabel);
});
+
+ test('history rows are hidden for supervised users', function() {
+ assertTrue(!!element.$$('#browsingCheckbox'));
+ assertTrue(!!element.$$('#downloadCheckbox'));
+
+ element.remove();
+ testBrowserProxy.reset();
+ testBrowserProxy.setShouldShowBrowsingHistoryRows(false);
+
+ element = document.createElement('settings-clear-browsing-data-dialog');
dpapad 2017/05/04 22:43:02 If we are going to recreate the element anyway, ju
Dan Beam 2017/05/04 23:21:28 Done. (thanks for reminding me about overrideValue
+ document.body.appendChild(element);
+ Polymer.dom.flush();
+
+ return testBrowserProxy.whenCalled('initialize').then(function() {
+ assertFalse(!!element.$$('#browsingCheckbox'));
+ assertFalse(!!element.$$('#downloadCheckbox'));
+ });
+ });
});
}
« 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