Chromium Code Reviews| 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')); |
| + }); |
| + }); |
| }); |
| } |