| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** @fileoverview Suite of tests for extension-item. */ | 5 /** @fileoverview Suite of tests for extension-item. */ |
| 6 cr.define('extension_item_tests', function() { | 6 cr.define('extension_item_tests', function() { |
| 7 /** | 7 /** |
| 8 * A mock delegate for the item, capable of testing functionality. | 8 * A mock delegate for the item, capable of testing functionality. |
| 9 * @constructor | 9 * @constructor |
| 10 * @extends {extension_test_util.ClickMock} | 10 * @extends {extension_test_util.ClickMock} |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 /** @override */ | 27 /** @override */ |
| 28 setItemAllowedIncognito: function(id, enabled) {}, | 28 setItemAllowedIncognito: function(id, enabled) {}, |
| 29 | 29 |
| 30 /** @override */ | 30 /** @override */ |
| 31 isInDevMode: function() { return false; }, | 31 isInDevMode: function() { return false; }, |
| 32 | 32 |
| 33 /** @override: */ | 33 /** @override: */ |
| 34 inspectItemView: function(id, view) {}, | 34 inspectItemView: function(id, view) {}, |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 /** @type {string} The mock extension's id. */ | |
| 38 var id = 'a'.repeat(32); | |
| 39 | |
| 40 /** @type {string} The mock extension's base URL. */ | |
| 41 var baseUrl = 'chrome-extension://' + id + '/'; | |
| 42 | |
| 43 /** | 37 /** |
| 44 * The data used to populate the extension item. | 38 * The data used to populate the extension item. |
| 45 * @type {ExtensionInfo} | 39 * @type {chrome.developerPrivate.ExtensionInfo} |
| 46 */ | 40 */ |
| 47 var extensionData = { | 41 var extensionData = extension_test_util.createExtensionInfo(); |
| 48 description: 'This is an extension', | |
| 49 iconUrl: 'chrome://extension-icon/' + id + '/24/0', | |
| 50 id: id, | |
| 51 incognitoAccess: {isEnabled: true, isActive: false}, | |
| 52 name: 'Wonderful Extension', | |
| 53 state: 'ENABLED', | |
| 54 type: 'EXTENSION', | |
| 55 version: '2.0', | |
| 56 views: [{url: baseUrl + 'foo.html'}, {url: baseUrl + 'bar.html'}], | |
| 57 }; | |
| 58 | 42 |
| 59 // The normal elements, which should always be shown. | 43 // The normal elements, which should always be shown. |
| 60 var normalElements = [ | 44 var normalElements = [ |
| 61 {selector: '#name', text: extensionData.name}, | 45 {selector: '#name', text: extensionData.name}, |
| 62 {selector: '#description', text: extensionData.description}, | 46 {selector: '#description', text: extensionData.description}, |
| 63 {selector: '#version', text: extensionData.version}, | 47 {selector: '#version', text: extensionData.version}, |
| 64 {selector: '#enabled'}, | 48 {selector: '#enabled'}, |
| 65 {selector: '#show-details'}, | 49 {selector: '#show-details'}, |
| 66 {selector: '#delete-button'}, | 50 {selector: '#delete-button'}, |
| 67 ]; | 51 ]; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 'inspectItemView', [item.data.id, item.data.views[1]]); | 197 'inspectItemView', [item.data.id, item.data.views[1]]); |
| 214 }); | 198 }); |
| 215 }); | 199 }); |
| 216 } | 200 } |
| 217 | 201 |
| 218 return { | 202 return { |
| 219 registerTests: registerTests, | 203 registerTests: registerTests, |
| 220 TestNames: TestNames, | 204 TestNames: TestNames, |
| 221 }; | 205 }; |
| 222 }); | 206 }); |
| OLD | NEW |