| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * An example empty pref. | 6 * An example empty pref. |
| 7 * @type {SiteSettingsPref} | 7 * @type {SiteSettingsPref} |
| 8 */ | 8 */ |
| 9 var prefsEmpty = { | 9 var prefsEmpty = { |
| 10 defaults: { | 10 defaults: { |
| 11 auto_downloads: '', | 11 auto_downloads: '', |
| 12 background_sync: '', | 12 background_sync: '', |
| 13 camera: '', | 13 camera: '', |
| 14 cookies: '', | 14 cookies: '', |
| 15 geolocation: '', | 15 geolocation: '', |
| 16 javascript: '', | 16 javascript: '', |
| 17 mic: '', | 17 mic: '', |
| 18 midiDevices: '', | 18 midiDevices: '', |
| 19 notifications: '', | 19 notifications: '', |
| 20 plugins: '', | 20 plugins: '', |
| 21 popups: '', | 21 popups: '', |
| 22 unsandboxed_plugins: '', | 22 unsandboxed_plugins: '', |
| 23 subresource_filter: '', |
| 23 }, | 24 }, |
| 24 exceptions: { | 25 exceptions: { |
| 25 auto_downloads: [], | 26 auto_downloads: [], |
| 26 background_sync: [], | 27 background_sync: [], |
| 27 camera: [], | 28 camera: [], |
| 28 cookies: [], | 29 cookies: [], |
| 29 geolocation: [], | 30 geolocation: [], |
| 30 javascript: [], | 31 javascript: [], |
| 31 mic: [], | 32 mic: [], |
| 32 midiDevices: [], | 33 midiDevices: [], |
| 33 notifications: [], | 34 notifications: [], |
| 34 plugins: [], | 35 plugins: [], |
| 35 popups: [], | 36 popups: [], |
| 36 unsandboxed_plugins: [], | 37 unsandboxed_plugins: [], |
| 38 subresource_filter: [], |
| 37 }, | 39 }, |
| 38 }; | 40 }; |
| 39 | 41 |
| 40 /** | 42 /** |
| 41 * A test version of SiteSettingsPrefsBrowserProxy. Provides helper methods | 43 * A test version of SiteSettingsPrefsBrowserProxy. Provides helper methods |
| 42 * for allowing tests to know when a method was called, as well as | 44 * for allowing tests to know when a method was called, as well as |
| 43 * specifying mock responses. | 45 * specifying mock responses. |
| 44 * | 46 * |
| 45 * @constructor | 47 * @constructor |
| 46 * @implements {settings.SiteSettingsPrefsBrowserProxy} | 48 * @implements {settings.SiteSettingsPrefsBrowserProxy} |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 else if (contentType == settings.ContentSettingsTypes.PDF_DOCUMENTS) | 222 else if (contentType == settings.ContentSettingsTypes.PDF_DOCUMENTS) |
| 221 pref = this.prefs_.exceptions.pdf_documents; | 223 pref = this.prefs_.exceptions.pdf_documents; |
| 222 else if (contentType == settings.ContentSettingsTypes.PLUGINS) | 224 else if (contentType == settings.ContentSettingsTypes.PLUGINS) |
| 223 pref = this.prefs_.exceptions.plugins; | 225 pref = this.prefs_.exceptions.plugins; |
| 224 else if (contentType == settings.ContentSettingsTypes.PROTECTED_CONTENT) | 226 else if (contentType == settings.ContentSettingsTypes.PROTECTED_CONTENT) |
| 225 pref = this.prefs_.exceptions.protectedContent; | 227 pref = this.prefs_.exceptions.protectedContent; |
| 226 else if (contentType == settings.ContentSettingsTypes.POPUPS) | 228 else if (contentType == settings.ContentSettingsTypes.POPUPS) |
| 227 pref = this.prefs_.exceptions.popups; | 229 pref = this.prefs_.exceptions.popups; |
| 228 else if (contentType == settings.ContentSettingsTypes.UNSANDBOXED_PLUGINS) | 230 else if (contentType == settings.ContentSettingsTypes.UNSANDBOXED_PLUGINS) |
| 229 pref = this.prefs_.exceptions.unsandboxed_plugins; | 231 pref = this.prefs_.exceptions.unsandboxed_plugins; |
| 232 else if (contentType == settings.ContentSettingsTypes.SUBRESOURCE_FILTER) |
| 233 pref = this.prefs_.exceptions.subresource_filer; |
| 230 else | 234 else |
| 231 console.log('getExceptionList received unknown category: ' + contentType); | 235 console.log('getExceptionList received unknown category: ' + contentType); |
| 232 | 236 |
| 233 assert(pref != undefined, 'Pref is missing for ' + contentType); | 237 assert(pref != undefined, 'Pref is missing for ' + contentType); |
| 234 return Promise.resolve(pref); | 238 return Promise.resolve(pref); |
| 235 }, | 239 }, |
| 236 | 240 |
| 237 /** @override */ | 241 /** @override */ |
| 238 isPatternValid: function(pattern) { | 242 isPatternValid: function(pattern) { |
| 239 this.methodCalled('isPatternValid', pattern); | 243 this.methodCalled('isPatternValid', pattern); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 /** @override */ | 315 /** @override */ |
| 312 setProtocolDefault: function() { | 316 setProtocolDefault: function() { |
| 313 this.methodCalled('setProtocolDefault', arguments); | 317 this.methodCalled('setProtocolDefault', arguments); |
| 314 }, | 318 }, |
| 315 | 319 |
| 316 /** @override */ | 320 /** @override */ |
| 317 removeProtocolHandler: function() { | 321 removeProtocolHandler: function() { |
| 318 this.methodCalled('removeProtocolHandler', arguments); | 322 this.methodCalled('removeProtocolHandler', arguments); |
| 319 } | 323 } |
| 320 }; | 324 }; |
| OLD | NEW |