Index: chrome/test/data/webui/extensions/extension_test_util.js |
diff --git a/chrome/test/data/webui/extensions/extension_test_util.js b/chrome/test/data/webui/extensions/extension_test_util.js |
index ccea8dfed8aef36382e994b1bbf2289df49f6c56..72d845afe3b6306ac38cdf5963c7661499655bc2 100644 |
--- a/chrome/test/data/webui/extensions/extension_test_util.js |
+++ b/chrome/test/data/webui/extensions/extension_test_util.js |
@@ -46,8 +46,33 @@ cr.define('extension_test_util', function() { |
expectEquals(opt_expected, element.textContent, selector); |
} |
+ /** |
+ * Creates an ExtensionInfo object. |
+ * @param {Object=} opt_properties A set of properties that will be used on |
+ * the resulting ExtensionInfo (otherwise defaults will be used). |
+ * @return {chrome.developerPrivate.ExtensionInfo} |
+ */ |
+ function createExtensionInfo(opt_properties) { |
+ var id = opt_properties && opt_properties.hasOwnProperty('id') ? |
+ opt_properties[id] : 'a'.repeat(32); |
+ var baseUrl = 'chrome-extension://' + id + '/'; |
+ return Object.assign({ |
+ description: 'This is an extension', |
+ iconUrl: 'chrome://extension-icon/' + id + '/24/0', |
+ id: id, |
+ incognitoAccess: {isEnabled: true, isActive: false}, |
+ location: 'FROM_STORE', |
+ name: 'Wonderful Extension', |
+ state: 'ENABLED', |
+ type: 'EXTENSION', |
+ version: '2.0', |
+ views: [{url: baseUrl + 'foo.html'}, {url: baseUrl + 'bar.html'}], |
+ }, opt_properties); |
+ } |
+ |
return { |
ClickMock: ClickMock, |
testVisible: testVisible, |
+ createExtensionInfo: createExtensionInfo, |
}; |
}); |