| 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 GEN('#include "chrome/browser/ui/webui/extensions/' + | 7 GEN('#include "chrome/browser/ui/webui/extensions/' + |
| 8 'extension_settings_browsertest.h"'); | 8 'extension_settings_browsertest.h"'); |
| 9 | 9 |
| 10 // chrome/test/data/extensions/good.crx's extension ID. good.crx is loaded by | 10 // chrome/test/data/extensions/good.crx's extension ID. good.crx is loaded by |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 /** @protected */ | 112 /** @protected */ |
| 113 verifyUninstallWorks: function() { | 113 verifyUninstallWorks: function() { |
| 114 var next = this.nextStep.bind(this); | 114 var next = this.nextStep.bind(this); |
| 115 chrome.test.runWithUserGesture(function() { | 115 chrome.test.runWithUserGesture(function() { |
| 116 chrome.management.uninstall(GOOD_CRX_ID, function() { | 116 chrome.management.uninstall(GOOD_CRX_ID, function() { |
| 117 assertEquals(null, $(GOOD_CRX_ID)); | 117 assertEquals(null, $(GOOD_CRX_ID)); |
| 118 next(); | 118 next(); |
| 119 }); | 119 }); |
| 120 }); | 120 }); |
| 121 }, | 121 }, |
| 122 |
| 123 /** @protected */ |
| 124 verifyDeveloperModeWorks: function() { |
| 125 var extensionSettings = getRequiredElement('extension-settings'); |
| 126 assertFalse(extensionSettings.classList.contains('dev-mode')); |
| 127 $('toggle-dev-on').click(); |
| 128 assertTrue(extensionSettings.classList.contains('dev-mode')); |
| 129 chrome.developerPrivate.getProfileConfiguration(function(profileInfo) { |
| 130 assertTrue(profileInfo.inDeveloperMode); |
| 131 this.nextStep(); |
| 132 }.bind(this)); |
| 133 }, |
| 122 }; | 134 }; |
| 123 | 135 |
| 124 TEST_F('BasicExtensionSettingsWebUITest', 'testDisable', function() { | 136 TEST_F('BasicExtensionSettingsWebUITest', 'testDisable', function() { |
| 125 this.steps = [this.waitForPageLoad, | 137 this.steps = [this.waitForPageLoad, |
| 126 this.verifyDisabledWorks, | 138 this.verifyDisabledWorks, |
| 127 testDone]; | 139 testDone]; |
| 128 this.nextStep(); | 140 this.nextStep(); |
| 129 }); | 141 }); |
| 130 | 142 |
| 131 TEST_F('BasicExtensionSettingsWebUITest', 'testEnable', function() { | 143 TEST_F('BasicExtensionSettingsWebUITest', 'testEnable', function() { |
| 132 this.steps = [this.waitForPageLoad, | 144 this.steps = [this.waitForPageLoad, |
| 133 this.verifyDisabledWorks, | 145 this.verifyDisabledWorks, |
| 134 this.verifyEnabledWorks, | 146 this.verifyEnabledWorks, |
| 135 testDone]; | 147 testDone]; |
| 136 this.nextStep(); | 148 this.nextStep(); |
| 137 }); | 149 }); |
| 138 | 150 |
| 139 TEST_F('BasicExtensionSettingsWebUITest', 'testUninstall', function() { | 151 TEST_F('BasicExtensionSettingsWebUITest', 'testUninstall', function() { |
| 140 this.steps = [this.waitForPageLoad, | 152 this.steps = [this.waitForPageLoad, |
| 141 this.verifyUninstallWorks, | 153 this.verifyUninstallWorks, |
| 142 testDone]; | 154 testDone]; |
| 143 this.nextStep(); | 155 this.nextStep(); |
| 144 }); | 156 }); |
| 145 | 157 |
| 158 TEST_F('BasicExtensionSettingsWebUITest', 'testDeveloperMode', function() { |
| 159 var next = this.nextStep.bind(this); |
| 160 var checkDevModeIsOff = function() { |
| 161 chrome.developerPrivate.getProfileConfiguration(function(profileInfo) { |
| 162 assertFalse(profileInfo.inDeveloperMode); |
| 163 next(); |
| 164 }); |
| 165 }; |
| 166 this.steps = [checkDevModeIsOff, |
| 167 this.waitForPageLoad, |
| 168 this.verifyDeveloperModeWorks, |
| 169 testDone]; |
| 170 this.nextStep(); |
| 171 }); |
| 172 |
| 146 function AsyncExtensionSettingsWebUITest() {} | 173 function AsyncExtensionSettingsWebUITest() {} |
| 147 | 174 |
| 148 AsyncExtensionSettingsWebUITest.prototype = { | 175 AsyncExtensionSettingsWebUITest.prototype = { |
| 149 __proto__: ExtensionSettingsWebUITest.prototype, | 176 __proto__: ExtensionSettingsWebUITest.prototype, |
| 150 | 177 |
| 151 /** @override */ | 178 /** @override */ |
| 152 isAsync: true, | 179 isAsync: true, |
| 153 | 180 |
| 154 /** @override */ | 181 /** @override */ |
| 155 testGenPreamble: function() { | 182 testGenPreamble: function() { |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 | 340 |
| 314 ExtensionOptionsDialogWebUITest.prototype = { | 341 ExtensionOptionsDialogWebUITest.prototype = { |
| 315 __proto__: InstalledExtensionSettingsWebUITest.prototype, | 342 __proto__: InstalledExtensionSettingsWebUITest.prototype, |
| 316 | 343 |
| 317 /** @override */ | 344 /** @override */ |
| 318 browsePreload: ExtensionSettingsWebUITest.prototype.browsePreload + | 345 browsePreload: ExtensionSettingsWebUITest.prototype.browsePreload + |
| 319 '?options=' + GOOD_CRX_ID, | 346 '?options=' + GOOD_CRX_ID, |
| 320 }; | 347 }; |
| 321 | 348 |
| 322 TEST_F('ExtensionOptionsDialogWebUITest', 'testAccessibility', runAudit); | 349 TEST_F('ExtensionOptionsDialogWebUITest', 'testAccessibility', runAudit); |
| OLD | NEW |