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

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: Add test 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..3ac239a477a44fb6019935e5735fecdc3058078a 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();
@@ -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(arguments) {
dschuyler 2016/09/28 19:13:40 |arguments| is a special value, like |this|. So ar
+ assertEquals('chrome-extension://cfhgfbfpcbnnbibfphagcjmgjfjmojfa/',
+ arguments[0]);
+ assertEquals('', arguments[1]);
+ assertEquals(settings.ContentSettingsTypes.JAVASCRIPT, arguments[2]);
+ assertEquals('allow', arguments[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