Chromium Code Reviews| 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..8b413735dab510f0b86dedb02efa524eefbc2a11 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; |
|
Dan Beam
2017/03/30 04:50:43
hasIncognito_
dschuyler
2017/03/30 21:06:16
See https://codereview.chromium.org/2787923002/
|
| + |
| /** @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) { |
| + var incognitoElements = []; |
| + for (var i = 0; i < pref.length; ++i) |
| + incognitoElements.push(Object.assign({incognito: true}, pref[i])); |
| + pref = pref.concat(incognitoElements); |
| + } |
| + |
| return Promise.resolve(pref); |
| }, |