| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // TODO(dbeam): test for loading upacked extensions? | 5 // TODO(dbeam): test for loading upacked extensions? |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * TestFixture for extension settings WebUI testing. | 8 * TestFixture for extension settings WebUI testing. |
| 9 * @extends {testing.Test} | 9 * @extends {testing.Test} |
| 10 * @constructor | 10 * @constructor |
| 11 */ | 11 */ |
| 12 function ExtensionSettingsWebUITest() {} | 12 function ExtensionSettingsWebUITest() {} |
| 13 | 13 |
| 14 ExtensionSettingsWebUITest.prototype = { | 14 ExtensionSettingsWebUITest.prototype = { |
| 15 __proto__: testing.Test.prototype, | 15 __proto__: testing.Test.prototype, |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * A URL to load before starting each test. | 18 * A URL to load before starting each test. |
| 19 * @type {string} | 19 * @type {string} |
| 20 * @const | 20 * @const |
| 21 */ | 21 */ |
| 22 browsePreload: 'chrome://extensions-frame/', | 22 browsePreload: 'chrome://extensions-frame/', |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 TEST_F('ExtensionSettingsWebUITest', 'testChromeSendHandled', function() { | 25 TEST_F('ExtensionSettingsWebUITest', 'testChromeSendHandled', function() { |
| 26 assertEquals(this.browsePreload, document.location.href); | 26 assertEquals(this.browsePreload, document.location.href); |
| 27 | 27 |
| 28 // This dialog should be hidden at first. | 28 // This dialog should be hidden at first. |
| 29 assertFalse($('packExtensionOverlay').classList.contains('showing')); | 29 assertFalse($('pack-extension-overlay').classList.contains('showing')); |
| 30 | 30 |
| 31 // Show the dialog, which triggers a chrome.send() for metrics purposes. | 31 // Show the dialog, which triggers a chrome.send() for metrics purposes. |
| 32 cr.dispatchSimpleEvent($('pack-extension'), 'click'); | 32 cr.dispatchSimpleEvent($('pack-extension'), 'click'); |
| 33 assertTrue($('packExtensionOverlay').classList.contains('showing')); | 33 assertTrue($('pack-extension-overlay').classList.contains('showing')); |
| 34 }); | 34 }); |
| 35 | 35 |
| 36 /** | 36 /** |
| 37 * TestFixture for extension settings WebUI testing (commands config edition). | 37 * TestFixture for extension settings WebUI testing (commands config edition). |
| 38 * @extends {testing.Test} | 38 * @extends {testing.Test} |
| 39 * @constructor | 39 * @constructor |
| 40 */ | 40 */ |
| 41 function ExtensionSettingsCommandsConfigWebUITest() {} | 41 function ExtensionSettingsCommandsConfigWebUITest() {} |
| 42 | 42 |
| 43 ExtensionSettingsCommandsConfigWebUITest.prototype = { | 43 ExtensionSettingsCommandsConfigWebUITest.prototype = { |
| 44 __proto__: testing.Test.prototype, | 44 __proto__: testing.Test.prototype, |
| 45 | 45 |
| 46 /** | 46 /** |
| 47 * A URL to load before starting each test. | 47 * A URL to load before starting each test. |
| 48 * @type {string} | 48 * @type {string} |
| 49 * @const | 49 * @const |
| 50 */ | 50 */ |
| 51 browsePreload: 'chrome://extensions-frame/configureCommands', | 51 browsePreload: 'chrome://extensions-frame/configureCommands', |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 TEST_F('ExtensionSettingsCommandsConfigWebUITest', 'testChromeSendHandler', | 54 TEST_F('ExtensionSettingsCommandsConfigWebUITest', 'testChromeSendHandler', |
| 55 function() { | 55 function() { |
| 56 // Just navigating to the page should trigger the chrome.send(). | 56 // Just navigating to the page should trigger the chrome.send(). |
| 57 assertEquals(this.browsePreload, document.location.href); | 57 assertEquals(this.browsePreload, document.location.href); |
| 58 assertTrue($('extensionCommandsOverlay').classList.contains('showing')); | 58 assertTrue($('extension-commands-overlay').classList.contains('showing')); |
| 59 }); | 59 }); |
| OLD | NEW |