Chromium Code Reviews| 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 4d564d6727c15d2710a8342a9131f1b1f5d8add2..ba8d0fb748d5c8626566deb37b4c10322cd7b299 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 |
| @@ -54,11 +54,14 @@ var TestSiteSettingsPrefsBrowserProxy = function() { |
| 'fetchZoomLevels', |
| 'getDefaultValueForContentType', |
| 'getExceptionList', |
| + 'initializeProtocolHandlerList', |
| + 'removeProtocolHandler', |
| 'removeUsbDevice', |
| 'removeZoomLevel', |
| 'resetCategoryPermissionForOrigin', |
| 'setCategoryPermissionForOrigin', |
| 'setDefaultValueForContentType', |
| + 'setProtocolDefault' |
| ]); |
| /** @private {!SiteSettingsPref} */ |
| @@ -69,6 +72,9 @@ var TestSiteSettingsPrefsBrowserProxy = function() { |
| /** @private {!Array<UsbDeviceEntry>} */ |
| this.usbDevices_ = []; |
| + |
| + /** @private {!Array<ProtocolEntry>} */ |
|
dpapad
2016/11/14 18:26:21
If those arrays do not hold null values, annotatio
scottchen
2016/11/14 21:38:37
Done.
|
| + this.protocolHandlers_ = []; |
| }; |
| TestSiteSettingsPrefsBrowserProxy.prototype = { |
| @@ -107,6 +113,15 @@ TestSiteSettingsPrefsBrowserProxy.prototype = { |
| this.usbDevices_ = list.slice(); |
| }, |
| + /** |
| + * Sets the prefs to use when testing. |
| + * @param {!Array<ProtocolEntry>} list The protocol handlers list to set. |
| + */ |
| + setProtocolHandlers: function(list) { |
| + // Shallow copy of the passed-in array so mutation won't impact the source |
| + this.protocolHandlers_ = list.slice(); |
| + }, |
| + |
| /** @override */ |
| setDefaultValueForContentType: function(contentType, defaultValue) { |
| this.methodCalled( |
| @@ -235,5 +250,23 @@ TestSiteSettingsPrefsBrowserProxy.prototype = { |
| /** @override */ |
| removeUsbDevice: function() { |
| this.methodCalled('removeUsbDevice', arguments); |
| + }, |
| + |
| + /** @override */ |
| + initializeProtocolHandlerList: function() { |
| + cr.webUIListenerCallback('setHandlersEnabled', true); |
| + cr.webUIListenerCallback('setProtocolHandlers', this.protocolHandlers_); |
| + this.methodCalled('initializeProtocolHandlerList'); |
| + return Promise.resolve(); |
|
dpapad
2016/11/14 18:26:21
The prod version of initializeProtocolHandlerList
scottchen
2016/11/14 21:38:37
Done.
|
| + }, |
| + |
| + /** @override */ |
| + setProtocolDefault: function() { |
| + this.methodCalled('setProtocolDefault', arguments); |
| + }, |
| + |
| + /** @override */ |
| + removeProtocolHandler: function() { |
| + this.methodCalled('removeProtocolHandler', arguments); |
| } |
| }; |