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

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

Issue 2381583002: Site Settings Desktop: Better support for chrome-extension scheme. (Closed)
Patch Set: Address feedback Created 4 years, 3 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
« no previous file with comments | « chrome/browser/resources/settings/site_settings/site_settings_behavior.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bb260e52320d361e6550ec24517c6bf251acbeae..57962f04f971d8c4ac02bcbc88dad6786653e43c 100644
--- a/chrome/test/data/webui/settings/site_list_tests.js
+++ b/chrome/test/data/webui/settings/site_list_tests.js
@@ -282,6 +282,23 @@ cr.define('site_list', function() {
}
};
+ /**
+ * An example Javascript pref with a chrome-extension:// scheme.
+ * @type {SiteSettingsPref}
+ */
+ var prefsChromeExtension = {
+ exceptions: {
+ javascript: [
+ {
+ embeddingOrigin: '',
+ origin: 'chrome-extension://cfhgfbfpcbnnbibfphagcjmgjfjmojfa/',
+ setting: 'block',
+ source: 'preference',
+ },
+ ]
+ }
+ };
+
// Import necessary html before running suite.
suiteSetup(function() {
CrSettingsPrefs.setInitialized();
@@ -499,11 +516,11 @@ cr.define('site_list', function() {
MockInteractions.tap(menuItems[2]);
return browserProxy.whenCalled(
'resetCategoryPermissionForOrigin');
- }).then(function(arguments) {
- assertEquals('http://foo.com', arguments[0]);
- assertEquals('http://foo.com', arguments[1]);
- assertEquals(settings.ContentSettingsTypes.COOKIES, arguments[2]);
- assertFalse(arguments[3]); // Incognito.
+ }).then(function(args) {
+ assertEquals('http://foo.com', args[0]);
+ assertEquals('http://foo.com', args[1]);
+ assertEquals(settings.ContentSettingsTypes.COOKIES, args[2]);
+ assertFalse(args[3]); // Incognito.
});
});
@@ -535,11 +552,11 @@ cr.define('site_list', function() {
MockInteractions.tap(menuItems[1]);
return browserProxy.whenCalled(
'resetCategoryPermissionForOrigin');
- }).then(function(arguments) {
- assertEquals('http://foo.com', arguments[0]);
- assertEquals('http://foo.com', arguments[1]);
- assertEquals(settings.ContentSettingsTypes.COOKIES, arguments[2]);
- assertTrue(arguments[3]); // Incognito.
+ }).then(function(args) {
+ assertEquals('http://foo.com', args[0]);
+ assertEquals('http://foo.com', args[1]);
+ assertEquals(settings.ContentSettingsTypes.COOKIES, args[2]);
+ assertTrue(args[3]); // Incognito.
});
});
@@ -768,6 +785,27 @@ cr.define('site_list', function() {
return browserProxy.whenCalled('setCategoryPermissionForOrigin');
});
});
+
+ test('Chrome Extension scheme', function() {
+ setupCategory(settings.ContentSettingsTypes.JAVASCRIPT,
+ settings.PermissionValues.BLOCK, prefsChromeExtension);
+ return browserProxy.whenCalled('getExceptionList').then(function(
+ contentType) {
+ Polymer.dom.flush();
+ assertMenu(['Allow', 'Remove'], testElement);
+
+ var menuItems = getMenuItems(testElement.$.listContainer, 0);
+ assertTrue(!!menuItems);
+ MockInteractions.tap(menuItems[0]); // Action: Allow.
+ return browserProxy.whenCalled('setCategoryPermissionForOrigin');
+ }).then(function(args) {
+ assertEquals('chrome-extension://cfhgfbfpcbnnbibfphagcjmgjfjmojfa/',
+ args[0]);
+ assertEquals('', args[1]);
+ assertEquals(settings.ContentSettingsTypes.JAVASCRIPT, args[2]);
+ assertEquals('allow', args[3]);
+ });
+ });
});
}
return {
« no previous file with comments | « chrome/browser/resources/settings/site_settings/site_settings_behavior.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698