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

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

Issue 2936003003: MD Settings: Set all content setting values in Site Details Javascript. (Closed)
Patch Set: Review comments. Created 3 years, 6 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/test/data/webui/settings/site_details_tests.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/test_site_settings_prefs_browser_proxy.js
diff --git a/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js b/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js
index bbd3864d703ee06e128eb2050431a176d758ca15..733ea20c349a6ff488c01cd2dac7f0af098fbf59 100644
--- a/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js
+++ b/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js
@@ -85,6 +85,7 @@ var TestSiteSettingsPrefsBrowserProxy = function() {
'getCookieDetails',
'getDefaultValueForContentType',
'getExceptionList',
+ 'getOriginPermissions',
'isPatternValid',
'observeProtocolHandlers',
'observeProtocolHandlersEnabledState',
@@ -313,6 +314,53 @@ TestSiteSettingsPrefsBrowserProxy.prototype = {
},
/** @override */
+ getOriginPermissions: function(origin, contentTypes) {
+ this.methodCalled('getOriginPermissions', [origin, contentTypes]);
+
+ var exceptionList = [];
+ contentTypes.forEach(function(contentType) {
+ // Convert |contentType| to its corresponding pref name, if different.
+ if (contentType == settings.ContentSettingsTypes.GEOLOCATION) {
+ contentType = 'geolocation';
+ } else if (contentType == settings.ContentSettingsTypes.CAMERA) {
+ contentType = 'camera';
+ } else if (contentType == settings.ContentSettingsTypes.MIC) {
+ contentType = 'mic';
+ } else if (contentType == settings.ContentSettingsTypes.BACKGROUND_SYNC) {
+ contentType = 'background_sync';
+ } else if (
+ contentType == settings.ContentSettingsTypes.AUTOMATIC_DOWNLOADS) {
+ contentType = 'auto_downloads';
+ } else if (
+ contentType == settings.ContentSettingsTypes.UNSANDBOXED_PLUGINS) {
+ contentType = 'unsandboxed_plugins';
+ }
+
+ var setting = undefined;
+ this.prefs_.exceptions[contentType].some(function(originPrefs) {
+ if (originPrefs.origin == origin) {
+ setting = originPrefs.setting;
+ return true;
+ }
+ });
+ assert(
+ settings !== undefined,
+ 'There was no exception set for origin: ' + origin +
+ ' and contentType: ' + contentType);
+
+ exceptionList.push({
+ embeddingOrigin: '',
+ incognito: false,
+ origin: origin,
+ displayName: '',
+ setting: setting,
+ source: undefined
+ })
+ }, this);
+ return Promise.resolve(exceptionList);
+ },
+
+ /** @override */
setCategoryPermissionForOrigin: function(
primaryPattern, secondaryPattern, contentType, value, incognito) {
this.methodCalled('setCategoryPermissionForOrigin',
« no previous file with comments | « chrome/test/data/webui/settings/site_details_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698