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

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

Issue 2021343003: MD Site Settings: Add five new top level categories (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback and add icons Created 4 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_list_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 a05734d0a98b2425c85877057d05fb97c26b69d8..11b7a60200de156e91118232c97671f21a0cb46c 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
@@ -8,24 +8,34 @@
*/
var prefsEmpty = {
defaults: {
- media_stream_camera: '',
+ auto_downloads: '',
+ background_sync: '',
+ camera: '',
cookies: '',
fullscreen: '',
geolocation: '',
javascript: '',
- media_stream_mic: '',
+ keygen: '',
+ mic: '',
notifications: '',
+ plugins: '',
popups: '',
+ unsandboxed_plugins: '',
},
exceptions: {
- media_stream_camera: [],
+ auto_downloads: [],
+ background_sync: [],
+ camera: [],
cookies: [],
fullscreen: [],
geolocation: [],
javascript: [],
- media_stream_mic: [],
+ keygen: [],
+ mic: [],
notifications: [],
+ plugins: [],
popups: [],
+ unsandboxed_plugins: [],
},
};
@@ -82,58 +92,82 @@ TestSiteSettingsPrefsBrowserProxy.prototype = {
getDefaultValueForContentType: function(contentType) {
this.methodCalled('getDefaultValueForContentType', contentType);
- if (contentType == settings.ContentSettingsTypes.CAMERA) {
- return Promise.resolve(
- this.prefs_.defaults.media_stream_camera != 'block');
+ var pref = undefined;
+ if (contentType == settings.ContentSettingsTypes.AUTOMATIC_DOWNLOADS) {
+ pref = this.prefs_.defaults.auto_downloads;
+ } else if (contentType == settings.ContentSettingsTypes.BACKGROUND_SYNC) {
+ pref = this.prefs_.background_sync;
+ } else if (contentType == settings.ContentSettingsTypes.CAMERA) {
+ pref = this.prefs_.defaults.camera;
} else if (contentType == settings.ContentSettingsTypes.COOKIES) {
- return Promise.resolve(this.prefs_.defaults.cookies != 'block');
+ pref = this.prefs_.defaults.cookies;
} else if (contentType == settings.ContentSettingsTypes.FULLSCREEN) {
- return Promise.resolve(this.prefs_.defaults.fullscreen != 'block');
+ pref = this.prefs_.defaults.fullscreen;
} else if (contentType == settings.ContentSettingsTypes.GEOLOCATION) {
- return Promise.resolve(this.prefs_.defaults.geolocation != 'block');
+ pref = this.prefs_.defaults.geolocation;
} else if (contentType == settings.ContentSettingsTypes.IMAGES) {
- return Promise.resolve(this.prefs_.defaults.images != 'block');
+ pref = this.prefs_.defaults.images;
} else if (contentType == settings.ContentSettingsTypes.JAVASCRIPT) {
- return Promise.resolve(this.prefs_.defaults.javascript != 'block');
+ pref = this.prefs_.defaults.javascript;
+ } else if (contentType == settings.ContentSettingsTypes.KEYGEN) {
+ pref = this.prefs_.defaults.keygen;
} else if (contentType == settings.ContentSettingsTypes.MIC) {
- return Promise.resolve(this.prefs_.defaults.media_stream_mic != 'block');
+ pref = this.prefs_.defaults.mic;
} else if (contentType == settings.ContentSettingsTypes.NOTIFICATIONS) {
- return Promise.resolve(this.prefs_.defaults.notifications != 'block');
+ pref = this.prefs_.defaults.notifications;
} else if (contentType == settings.ContentSettingsTypes.POPUPS) {
- return Promise.resolve(this.prefs_.defaults.popups != 'block');
+ pref = this.prefs_.defaults.popups;
+ } else if (contentType == settings.ContentSettingsTypes.PLUGINS) {
+ pref = this.prefs_.defaults.plugins;
+ } else if (
+ contentType == settings.ContentSettingsTypes.UNSANDBOXED_PLUGINS) {
+ pref = this.prefs_.defaults.unsandboxed_plugins;
} else {
console.log('getDefault received unknown category: ' + contentType);
}
- return Promise.resolve([]);
+ assert(pref != undefined, 'Pref is missing for ' + contentType);
+ return Promise.resolve(pref != 'block');
},
/** @override */
getExceptionList: function(contentType) {
this.methodCalled('getExceptionList', contentType);
- if (contentType == settings.ContentSettingsTypes.CAMERA)
- return Promise.resolve(this.prefs_.exceptions.media_stream_camera);
+ var pref = undefined;
+ if (contentType == settings.ContentSettingsTypes.AUTOMATIC_DOWNLOADS)
+ pref = this.prefs_.exceptions.auto_downloads;
+ else if (contentType == settings.ContentSettingsTypes.BACKGROUND_SYNC)
+ pref = this.prefs_.exceptions.background_sync;
+ else if (contentType == settings.ContentSettingsTypes.CAMERA)
+ pref = this.prefs_.exceptions.camera;
else if (contentType == settings.ContentSettingsTypes.COOKIES)
- return Promise.resolve(this.prefs_.exceptions.cookies);
+ pref = this.prefs_.exceptions.cookies;
else if (contentType == settings.ContentSettingsTypes.FULLSCREEN)
- return Promise.resolve(this.prefs_.exceptions.fullscreen);
+ pref = this.prefs_.exceptions.fullscreen;
else if (contentType == settings.ContentSettingsTypes.GEOLOCATION)
- return Promise.resolve(this.prefs_.exceptions.geolocation);
+ pref = this.prefs_.exceptions.geolocation;
else if (contentType == settings.ContentSettingsTypes.IMAGES)
- return Promise.resolve(this.prefs_.exceptions.images);
+ pref = this.prefs_.exceptions.images;
else if (contentType == settings.ContentSettingsTypes.JAVASCRIPT)
- return Promise.resolve(this.prefs_.exceptions.javascript);
+ pref = this.prefs_.exceptions.javascript;
+ else if (contentType == settings.ContentSettingsTypes.KEYGEN)
+ pref = this.prefs_.exceptions.keygen;
else if (contentType == settings.ContentSettingsTypes.MIC)
- return Promise.resolve(this.prefs_.exceptions.media_stream_mic);
+ pref = this.prefs_.exceptions.mic;
else if (contentType == settings.ContentSettingsTypes.NOTIFICATIONS)
- return Promise.resolve(this.prefs_.exceptions.notifications);
+ pref = this.prefs_.exceptions.notifications;
+ else if (contentType == settings.ContentSettingsTypes.PLUGINS)
+ pref = this.prefs_.exceptions.plugins;
else if (contentType == settings.ContentSettingsTypes.POPUPS)
- return Promise.resolve(this.prefs_.exceptions.popups);
+ pref = this.prefs_.exceptions.popups;
+ else if (contentType == settings.ContentSettingsTypes.UNSANDBOXED_PLUGINS)
+ pref = this.prefs_.exceptions.unsandboxed_plugins;
else
console.log('getExceptionList received unknown category: ' + contentType);
- return Promise.resolve([]);
+ assert(pref != undefined, 'Pref is missing for ' + contentType);
+ return Promise.resolve(pref);
},
/** @override */
« no previous file with comments | « chrome/test/data/webui/settings/site_list_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698