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

Unified Diff: chrome/test/data/webui/settings/site_list_tests.js

Issue 2769863006: [MD settings] unit test for incognito activation (Closed)
Patch Set: reset resolver; .list-item Created 3 years, 9 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
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..69ffd9d0ad22186a2458a15f3d2bc7862868e65c 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,36 @@ 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);
+ var siteList = testElement.$$('#listContainer');
+ return browserProxy.whenCalled('getExceptionList').then(
+ function(actualContentType) {
+ Polymer.dom.flush();
+ assertEquals(1, siteList.querySelectorAll('.list-item').length);
+ browserProxy.resetResolver('getExceptionList');
+ browserProxy.setIncognito(true);
+ return browserProxy.whenCalled('getExceptionList');
+ }).then(function() {
+ Polymer.dom.flush();
+ assertEquals(2, siteList.querySelectorAll('.list-item').length);
+ browserProxy.resetResolver('getExceptionList');
+ browserProxy.setIncognito(false);
+ return browserProxy.whenCalled('getExceptionList');
+ }).then(function() {
+ Polymer.dom.flush();
+ assertEquals(1, siteList.querySelectorAll('.list-item').length);
+ browserProxy.resetResolver('getExceptionList');
+ browserProxy.setIncognito(true);
+ return browserProxy.whenCalled('getExceptionList');
+ }).then(function() {
+ Polymer.dom.flush();
+ assertEquals(2, siteList.querySelectorAll('.list-item').length);
+ });
+ });
+
test('initial INCOGNITO BLOCK state is correct', function() {
var contentType = settings.ContentSettingsTypes.COOKIES;
var categorySubtype = settings.PermissionValues.BLOCK;

Powered by Google App Engine
This is Rietveld 408576698