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

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

Issue 2468363005: [MD settings] show blocked sites even when category is blocked (Closed)
Patch Set: fixes Created 4 years, 1 month 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 3fe144759b5fb24fb6de0868d419a63b2d745d13..95d2319f958265d00a46c24fbe09fd34a0f57cec 100644
--- a/chrome/test/data/webui/settings/site_list_tests.js
+++ b/chrome/test/data/webui/settings/site_list_tests.js
@@ -364,11 +364,11 @@ cr.define('site_list', function() {
/**
* Configures the test element for a particular category.
- * @param {settings.ContentSettingsTypes} category The category to setup.
+ * @param {settings.ContentSettingsTypes} category The category to set up.
* @param {settings.PermissionValues} subtype Type of list to use.
* @param {Array<dictionary>} prefs The prefs to use.
*/
- function setupCategory(category, subtype, prefs) {
+ function setUpCategory(category, subtype, prefs) {
browserProxy.setPrefs(prefs);
if (category == settings.ALL_SITES) {
testElement.categorySubtype = settings.INVALID_CATEGORY_SUBTYPE;
@@ -387,7 +387,7 @@ cr.define('site_list', function() {
}
test('getExceptionList API used', function() {
- setupCategory(settings.ContentSettingsTypes.GEOLOCATION,
+ setUpCategory(settings.ContentSettingsTypes.GEOLOCATION,
settings.PermissionValues.ALLOW, prefsEmpty);
return browserProxy.whenCalled('getExceptionList').then(
function(contentType) {
@@ -397,7 +397,7 @@ cr.define('site_list', function() {
});
test('Empty list', function() {
- setupCategory(settings.ContentSettingsTypes.GEOLOCATION,
+ setUpCategory(settings.ContentSettingsTypes.GEOLOCATION,
settings.PermissionValues.ALLOW, prefsEmpty);
return browserProxy.whenCalled('getExceptionList').then(
function(contentType) {
@@ -419,7 +419,7 @@ cr.define('site_list', function() {
});
test('initial ALLOW state is correct', function() {
- setupCategory(settings.ContentSettingsTypes.GEOLOCATION,
+ setUpCategory(settings.ContentSettingsTypes.GEOLOCATION,
settings.PermissionValues.ALLOW, prefs);
return browserProxy.whenCalled('getExceptionList').then(
function(contentType) {
@@ -447,7 +447,7 @@ cr.define('site_list', function() {
});
test('initial BLOCK state is correct', function() {
- setupCategory(settings.ContentSettingsTypes.GEOLOCATION,
+ setUpCategory(settings.ContentSettingsTypes.GEOLOCATION,
settings.PermissionValues.BLOCK, prefs);
return browserProxy.whenCalled('getExceptionList').then(
function(contentType) {
@@ -464,18 +464,19 @@ cr.define('site_list', function() {
openActionMenu(0);
assertMenu(['Allow', 'Remove'], testElement);
- // Site list should only show when category default is enabled.
+ // Site list should show regardless of whether category the
+ // default is enabled.
dpapad 2016/11/07 21:59:35 Seems that there is an extra "the", not sure.
dschuyler 2016/11/07 23:54:04 Done.
assertFalse(testElement.$.category.hidden);
browserProxy.resetResolver('getExceptionList');
testElement.categoryEnabled = false;
return browserProxy.whenCalled('getExceptionList');
}).then(function(contentType) {
- assertTrue(testElement.$.category.hidden);
+ assertFalse(testElement.$.category.hidden);
});
});
test('initial SESSION ONLY state is correct', function() {
- setupCategory(settings.ContentSettingsTypes.COOKIES,
+ setUpCategory(settings.ContentSettingsTypes.COOKIES,
settings.PermissionValues.SESSION_ONLY, prefsSessionOnly);
return browserProxy.whenCalled('getExceptionList').then(
function(contentType) {
@@ -504,7 +505,7 @@ cr.define('site_list', function() {
});
test('initial INCOGNITO BLOCK state is correct', function() {
- setupCategory(settings.ContentSettingsTypes.COOKIES,
+ setUpCategory(settings.ContentSettingsTypes.COOKIES,
settings.PermissionValues.BLOCK, prefsIncognito);
return browserProxy.whenCalled('getExceptionList').then(
function(contentType) {
@@ -536,7 +537,7 @@ cr.define('site_list', function() {
});
test('initial INCOGNITO ALLOW state is correct', function() {
- setupCategory(settings.ContentSettingsTypes.COOKIES,
+ setUpCategory(settings.ContentSettingsTypes.COOKIES,
settings.PermissionValues.ALLOW, prefsIncognito);
return browserProxy.whenCalled('getExceptionList').then(
function(contentType) {
@@ -573,7 +574,7 @@ cr.define('site_list', function() {
});
test('list items shown and clickable when data is present', function() {
- setupCategory(settings.ContentSettingsTypes.GEOLOCATION,
+ setUpCategory(settings.ContentSettingsTypes.GEOLOCATION,
settings.PermissionValues.ALLOW, prefs);
return browserProxy.whenCalled('getExceptionList').then(
function(contentType) {
@@ -602,7 +603,7 @@ cr.define('site_list', function() {
test('Block list open when Allow list is empty', function() {
// Prefs: One item in Block list, nothing in Allow list.
- setupCategory(settings.ContentSettingsTypes.GEOLOCATION,
+ setUpCategory(settings.ContentSettingsTypes.GEOLOCATION,
settings.PermissionValues.BLOCK, prefsOneDisabled);
return browserProxy.whenCalled('getExceptionList').then(
function(contentType) {
@@ -616,7 +617,7 @@ cr.define('site_list', function() {
test('Block list closed when Allow list is not empty', function() {
// Prefs: Items in both Block and Allow list.
- setupCategory(settings.ContentSettingsTypes.GEOLOCATION,
+ setUpCategory(settings.ContentSettingsTypes.GEOLOCATION,
settings.PermissionValues.BLOCK, prefs);
return browserProxy.whenCalled('getExceptionList').then(
function(contentType) {
@@ -629,7 +630,7 @@ cr.define('site_list', function() {
test('Allow list is always open (Block list empty)', function() {
// Prefs: One item in Allow list, nothing in Block list.
- setupCategory(settings.ContentSettingsTypes.GEOLOCATION,
+ setUpCategory(settings.ContentSettingsTypes.GEOLOCATION,
settings.PermissionValues.ALLOW, prefsOneEnabled);
return browserProxy.whenCalled('getExceptionList').then(
function(contentType) {
@@ -644,7 +645,7 @@ cr.define('site_list', function() {
test('Allow list is always open (Block list non-empty)', function() {
// Prefs: Items in both Block and Allow list.
- setupCategory(settings.ContentSettingsTypes.GEOLOCATION,
+ setUpCategory(settings.ContentSettingsTypes.GEOLOCATION,
settings.PermissionValues.ALLOW, prefs);
return browserProxy.whenCalled('getExceptionList').then(
function(contentType) {
@@ -658,7 +659,7 @@ cr.define('site_list', function() {
test('Block list not hidden when empty', function() {
// Prefs: One item in Allow list, nothing in Block list.
- setupCategory(settings.ContentSettingsTypes.GEOLOCATION,
+ setUpCategory(settings.ContentSettingsTypes.GEOLOCATION,
settings.PermissionValues.BLOCK, prefsOneEnabled);
return browserProxy.whenCalled('getExceptionList').then(
function(contentType) {
@@ -670,7 +671,7 @@ cr.define('site_list', function() {
test('Allow list not hidden when empty', function() {
// Prefs: One item in Block list, nothing in Allow list.
- setupCategory(settings.ContentSettingsTypes.GEOLOCATION,
+ setUpCategory(settings.ContentSettingsTypes.GEOLOCATION,
settings.PermissionValues.ALLOW, prefsOneDisabled);
return browserProxy.whenCalled('getExceptionList').then(
function(contentType) {
@@ -682,7 +683,7 @@ cr.define('site_list', function() {
test('All sites category', function() {
// Prefs: Multiple and overlapping sites.
- setupCategory(settings.ALL_SITES, '', prefsVarious);
+ setUpCategory(settings.ALL_SITES, '', prefsVarious);
return browserProxy.whenCalled('getExceptionList').then(
function(contentType) {
@@ -726,7 +727,7 @@ cr.define('site_list', function() {
test('All sites mixed pattern and origin', function() {
// Prefs: One site, represented as origin and pattern.
- setupCategory(settings.ALL_SITES, '', prefsMixedOriginAndPattern);
+ setUpCategory(settings.ALL_SITES, '', prefsMixedOriginAndPattern);
return browserProxy.whenCalled('getExceptionList').then(
function(contentType) {
@@ -768,7 +769,7 @@ cr.define('site_list', function() {
test('Mixed schemes (present and absent)', function() {
// Prefs: One item with scheme and one without.
- setupCategory(settings.ContentSettingsTypes.GEOLOCATION,
+ setUpCategory(settings.ContentSettingsTypes.GEOLOCATION,
settings.PermissionValues.ALLOW, prefsMixedSchemes);
return browserProxy.whenCalled('getExceptionList').then(
function(contentType) {
@@ -778,7 +779,7 @@ cr.define('site_list', function() {
test('Select menu item', function() {
// Test for error: "Cannot read property 'origin' of undefined".
- setupCategory(settings.ContentSettingsTypes.GEOLOCATION,
+ setUpCategory(settings.ContentSettingsTypes.GEOLOCATION,
settings.PermissionValues.ALLOW, prefs);
return browserProxy.whenCalled('getExceptionList').then(function(
contentType) {
@@ -792,7 +793,7 @@ cr.define('site_list', function() {
});
test('Chrome Extension scheme', function() {
- setupCategory(settings.ContentSettingsTypes.JAVASCRIPT,
+ setUpCategory(settings.ContentSettingsTypes.JAVASCRIPT,
settings.PermissionValues.BLOCK, prefsChromeExtension);
return browserProxy.whenCalled('getExceptionList').then(function(
contentType) {

Powered by Google App Engine
This is Rietveld 408576698