Chromium Code Reviews| Index: chrome/test/data/webui/settings/site_list_tests.js |
| diff --git a/chrome/test/data/webui/settings/site_list_tests.js b/chrome/test/data/webui/settings/site_list_tests.js |
| index 1cf86362890a2406b1f47cd4565e5d0099f97ea5..c2387110eb885924fc7e3f0b1c257ac785072f6d 100644 |
| --- a/chrome/test/data/webui/settings/site_list_tests.js |
| +++ b/chrome/test/data/webui/settings/site_list_tests.js |
| @@ -59,6 +59,24 @@ cr.define('site_list', function() { |
| }; |
| /** |
| + * An example of prefs controlleBy policy. |
| + * @type {SiteSettingsPref} |
| + */ |
| + var prefsControlled = { |
| + exceptions: { |
| + plugins: [ |
| + { |
| + category: 'plugins', |
| + embeddingOrigin: 'http://foo-block.com', |
| + origin: 'http://foo-block.com', |
| + setting: 'block', |
| + source: 'policy', |
| + }, |
| + ] |
| + } |
| + }; |
| + |
| + /** |
| * An example pref with mixed schemes (present and absent). |
| * @type {SiteSettingsPref} |
| */ |
| @@ -594,6 +612,28 @@ cr.define('site_list', function() { |
| }); |
| }); |
| + test('update lists for incognito', function() { |
| + var contentType = settings.ContentSettingsTypes.PLUGINS; |
| + var categorySubtype = settings.PermissionValues.BLOCK; |
| + setUpCategory(contentType, categorySubtype, prefsControlled); |
| + return browserProxy.whenCalled('getExceptionList').then( |
| + function(actualContentType) { |
| + assertEquals(1, testElement.sites.length); |
| + browserProxy.setIncognito(true); |
| + return browserProxy.whenCalled('getExceptionList'); |
|
dpapad
2017/03/23 21:31:45
Are you waiting on a new call to getExceptionList(
dschuyler
2017/03/23 22:13:50
Done.
|
| + }).then(function() { |
| + assertEquals(2, testElement.sites.length); |
|
dpapad
2017/03/23 21:31:45
Asserting that the |sites| Polymer property has a
dschuyler
2017/03/23 22:13:51
We can; I've switched it. I'm concerned that this
|
| + browserProxy.setIncognito(false); |
| + return browserProxy.whenCalled('getExceptionList'); |
| + }).then(function() { |
| + assertEquals(1, testElement.sites.length); |
| + browserProxy.setIncognito(true); |
| + return browserProxy.whenCalled('getExceptionList'); |
| + }).then(function() { |
| + assertEquals(2, testElement.sites.length); |
| + }); |
| + }); |
| + |
| test('initial INCOGNITO BLOCK state is correct', function() { |
| var contentType = settings.ContentSettingsTypes.COOKIES; |
| var categorySubtype = settings.PermissionValues.BLOCK; |