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

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

Issue 2480843003: change site-settings -> usb-device to use cr-action-menu instead of paper-menu (Closed)
Patch Set: move helper function out of test function scope Created 4 years, 1 month 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
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 2f4f8eb157c351b0773431c78d08d02d9614d173..a3c593e6ef2cf2536c4fa113da2737ea515cc85b 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
@@ -50,9 +50,11 @@ var prefsEmpty = {
*/
var TestSiteSettingsPrefsBrowserProxy = function() {
settings.TestBrowserProxy.call(this, [
+ 'fetchUsbDevices',
'fetchZoomLevels',
'getDefaultValueForContentType',
'getExceptionList',
+ 'removeUsbDevice',
'removeZoomLevel',
'resetCategoryPermissionForOrigin',
'setCategoryPermissionForOrigin',
@@ -64,6 +66,9 @@ var TestSiteSettingsPrefsBrowserProxy = function() {
/** @private {!Array<ZoomLevelEntry>} */
this.zoomList_ = [];
+
+ /** @private {!Array<UsbDeviceEntry>} */
+ this.usbDevices_ = [];
};
TestSiteSettingsPrefsBrowserProxy.prototype = {
@@ -87,12 +92,21 @@ TestSiteSettingsPrefsBrowserProxy.prototype = {
/**
* Sets the prefs to use when testing.
- * @param !Array<ZoomLevelEntry> list The zoom list to set.
+ * @param {!Array<ZoomLevelEntry>} list The zoom list to set.
*/
setZoomList: function(list) {
this.zoomList_ = list;
},
+ /**
+ * Sets the prefs to use when testing.
+ * @param {!Array<UsbDeviceEntry>} list The usb device entry list to set.
+ */
+ setUsbDevices: function(list) {
+ // Shallow copy of the passed-in array so mutation won't impact the source
+ this.usbDevices_ = list.slice();
+ },
+
/** @override */
setDefaultValueForContentType: function(contentType, defaultValue) {
this.methodCalled(
@@ -207,4 +221,15 @@ TestSiteSettingsPrefsBrowserProxy.prototype = {
removeZoomLevel: function(host) {
this.methodCalled('removeZoomLevel', [host]);
},
+
+ /** @override */
+ fetchUsbDevices: function() {
+ this.methodCalled('fetchUsbDevices');
+ return Promise.resolve(this.usbDevices_);
+ },
+
+ /** @override */
+ removeUsbDevice: function() {
+ this.methodCalled('removeUsbDevice', arguments);
+ }
};

Powered by Google App Engine
This is Rietveld 408576698