| Index: chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js
|
| diff --git a/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js b/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js
|
| index 6fe9b1ca4a670e19f9e30d280c432135acc73109..ef7069b910a07af76810c9ecb0700fe7e5603a57 100644
|
| --- a/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js
|
| +++ b/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js
|
| @@ -67,6 +67,9 @@ var TestSiteSettingsPrefsBrowserProxy = function() {
|
| 'setProtocolDefault'
|
| ]);
|
|
|
| + /** @private {boolean} */
|
| + this.hasIncognito = false;
|
| +
|
| /** @private {!SiteSettingsPref} */
|
| this.prefs_ = prefsEmpty;
|
|
|
| @@ -90,6 +93,15 @@ TestSiteSettingsPrefsBrowserProxy.prototype = {
|
| __proto__: settings.TestBrowserProxy.prototype,
|
|
|
| /**
|
| + * Pretends an incognito session started or ended.
|
| + * @param {boolean} hasIncognito True for session started.
|
| + */
|
| + setIncognito: function(hasIncognito) {
|
| + this.hasIncognito = hasIncognito;
|
| + cr.webUIListenerCallback('onIncognitoStatusChanged', hasIncognito);
|
| + },
|
| +
|
| + /**
|
| * Sets the prefs to use when testing.
|
| * @param {!SiteSettingsPref} prefs The prefs to set.
|
| */
|
| @@ -231,6 +243,14 @@ TestSiteSettingsPrefsBrowserProxy.prototype = {
|
| console.log('getExceptionList received unknown category: ' + contentType);
|
|
|
| assert(pref != undefined, 'Pref is missing for ' + contentType);
|
| +
|
| + if (this.hasIncognito) {
|
| + pref = pref.concat(pref.filter(function(p) {
|
| + if (p.source == 'policy')
|
| + return Object.assign({incognito: true}, p);
|
| + }));
|
| + }
|
| +
|
| return Promise.resolve(pref);
|
| },
|
|
|
|
|