| 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..827043cbe379b84343613cef8ff2b703ffac734a 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
|
| @@ -94,6 +94,7 @@ var TestSiteSettingsPrefsBrowserProxy = function() {
|
| 'removeUsbDevice',
|
| 'removeZoomLevel',
|
| 'resetCategoryPermissionForOrigin',
|
| + 'getCategoryPermissionForOrigin',
|
| 'setCategoryPermissionForOrigin',
|
| 'setDefaultValueForContentType',
|
| 'setProtocolDefault',
|
| @@ -313,6 +314,53 @@ TestSiteSettingsPrefsBrowserProxy.prototype = {
|
| },
|
|
|
| /** @override */
|
| + getCategoryPermissionForOrigin: function(
|
| + contentType, origin, embeddingOrigin) {
|
| + this.methodCalled(
|
| + 'getCategoryPermissionForOrigin',
|
| + [contentType, origin, embeddingOrigin]);
|
| +
|
| + // 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);
|
| +
|
| + return Promise.resolve({
|
| + embeddingOrigin: embeddingOrigin,
|
| + embeddingDisplayName: '',
|
| + incognito: false,
|
| + origin: origin,
|
| + displayName: '',
|
| + setting: setting,
|
| + source: undefined
|
| + });
|
| + },
|
| +
|
| + /** @override */
|
| setCategoryPermissionForOrigin: function(
|
| primaryPattern, secondaryPattern, contentType, value, incognito) {
|
| this.methodCalled('setCategoryPermissionForOrigin',
|
|
|