Index: chrome/browser/ui/webui/extensions/extension_settings_browsertest.js |
diff --git a/chrome/browser/ui/webui/extensions/extension_settings_browsertest.js b/chrome/browser/ui/webui/extensions/extension_settings_browsertest.js |
index 9f1b86756ae5586369cfbfdc861291ad541839e9..b5a4aa59ba96b6ff109ccc94d9ac456e371d6dbf 100644 |
--- a/chrome/browser/ui/webui/extensions/extension_settings_browsertest.js |
+++ b/chrome/browser/ui/webui/extensions/extension_settings_browsertest.js |
@@ -56,6 +56,95 @@ TEST_F('ExtensionSettingsWebUITest', 'testChromeSendHandled', function() { |
assertTrue($('pack-extension-overlay').classList.contains('showing')); |
}); |
+function BasicExtensionSettingsWebUITest() {} |
+ |
+BasicExtensionSettingsWebUITest.prototype = { |
+ __proto__: ExtensionSettingsWebUITest.prototype, |
+ |
+ /** @override */ |
+ isAsync: true, |
+ |
+ /** @override */ |
+ testGenPreamble: function() { |
+ // Install multiple types of extensions to ensure we handle each type. |
+ // TODO(devlin): There are more types to add here. |
+ GEN(' InstallGoodExtension();'); |
+ GEN(' InstallErrorsExtension();'); |
+ GEN(' InstallSharedModule();'); |
+ GEN(' InstallPackagedApp();'); |
+ |
+ GEN(' SetAutoConfirmUninstall();'); |
+ }, |
+ |
+ /** @protected {Array<!Function>} */ |
+ steps: [], |
+ |
+ /** @protected */ |
+ nextStep: function() { |
+ assertTrue(this.steps.length > 0); |
+ this.steps.shift().bind(this)(); |
Dan Beam
2015/04/06 23:53:12
.call(this)
Devlin
2015/04/07 16:07:54
Done.
|
+ }, |
+ |
+ /** @protected */ |
+ waitForPageLoad: function() { |
+ extensionList = $('extension-settings-list'); |
+ extensionList.extensionsUpdated_.then(this.nextStep.bind(this)); |
+ }, |
+ |
+ /** @protected */ |
+ verifyDisabledWorks: function() { |
+ chrome.management.setEnabled(GOOD_CRX_ID, false, function() { |
+ var node = $(GOOD_CRX_ID); |
Dan Beam
2015/04/06 23:53:12
$ -> getRequiredElement
Devlin
2015/04/07 16:07:54
Done.
|
+ assertTrue(node != null); |
+ assertTrue(node.classList.contains('inactive-extension')); |
+ this.nextStep(); |
+ }.bind(this)); |
+ }, |
+ |
+ /** @protected */ |
+ verifyEnabledWorks: function() { |
+ chrome.management.setEnabled(GOOD_CRX_ID, true, function() { |
+ var node = $(GOOD_CRX_ID); |
+ assertTrue(node != null); |
Dan Beam
2015/04/06 23:53:12
getRequiredElement
Devlin
2015/04/07 16:07:54
Done.
|
+ assertFalse(node.classList.contains('inactive-extension')); |
+ this.nextStep(); |
+ }.bind(this)); |
+ }, |
+ |
+ /** @protected */ |
+ verifyUninstallWorks: function() { |
+ var next = this.nextStep.bind(this); |
+ chrome.test.runWithUserGesture(function() { |
+ chrome.management.uninstall(GOOD_CRX_ID, function() { |
+ assertEquals(null, $(GOOD_CRX_ID)); |
+ next(); |
+ }); |
+ }); |
+ }, |
+}; |
+ |
+TEST_F('BasicExtensionSettingsWebUITest', 'testDisable', function() { |
+ this.steps = [this.waitForPageLoad, |
+ this.verifyDisabledWorks, |
+ testDone]; |
+ this.nextStep(); |
+}); |
+ |
+TEST_F('BasicExtensionSettingsWebUITest', 'testEnable', function() { |
+ this.steps = [this.waitForPageLoad, |
+ this.verifyDisabledWorks, |
+ this.verifyEnabledWorks, |
+ testDone]; |
+ this.nextStep(); |
+}); |
+ |
+TEST_F('BasicExtensionSettingsWebUITest', 'testUninstall', function() { |
+ this.steps = [this.waitForPageLoad, |
+ this.verifyUninstallWorks, |
+ testDone]; |
+ this.nextStep(); |
+}); |
+ |
function AsyncExtensionSettingsWebUITest() {} |
AsyncExtensionSettingsWebUITest.prototype = { |