| 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 }, | |
| 134 }; | 122 }; |
| 135 | 123 |
| 136 TEST_F('BasicExtensionSettingsWebUITest', 'testDisable', function() { | 124 TEST_F('BasicExtensionSettingsWebUITest', 'testDisable', function() { |
| 137 this.steps = [this.waitForPageLoad, | 125 this.steps = [this.waitForPageLoad, |
| 138 this.verifyDisabledWorks, | 126 this.verifyDisabledWorks, |
| 139 testDone]; | 127 testDone]; |
| 140 this.nextStep(); | 128 this.nextStep(); |
| 141 }); | 129 }); |
| 142 | 130 |
| 143 TEST_F('BasicExtensionSettingsWebUITest', 'testEnable', function() { | 131 TEST_F('BasicExtensionSettingsWebUITest', 'testEnable', function() { |
| 144 this.steps = [this.waitForPageLoad, | 132 this.steps = [this.waitForPageLoad, |
| 145 this.verifyDisabledWorks, | 133 this.verifyDisabledWorks, |
| 146 this.verifyEnabledWorks, | 134 this.verifyEnabledWorks, |
| 147 testDone]; | 135 testDone]; |
| 148 this.nextStep(); | 136 this.nextStep(); |
| 149 }); | 137 }); |
| 150 | 138 |
| 151 TEST_F('BasicExtensionSettingsWebUITest', 'testUninstall', function() { | 139 TEST_F('BasicExtensionSettingsWebUITest', 'testUninstall', function() { |
| 152 this.steps = [this.waitForPageLoad, | 140 this.steps = [this.waitForPageLoad, |
| 153 this.verifyUninstallWorks, | 141 this.verifyUninstallWorks, |
| 154 testDone]; | 142 testDone]; |
| 155 this.nextStep(); | 143 this.nextStep(); |
| 156 }); | 144 }); |
| 157 | 145 |
| 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 | |
| 173 function AsyncExtensionSettingsWebUITest() {} | 146 function AsyncExtensionSettingsWebUITest() {} |
| 174 | 147 |
| 175 AsyncExtensionSettingsWebUITest.prototype = { | 148 AsyncExtensionSettingsWebUITest.prototype = { |
| 176 __proto__: ExtensionSettingsWebUITest.prototype, | 149 __proto__: ExtensionSettingsWebUITest.prototype, |
| 177 | 150 |
| 178 /** @override */ | 151 /** @override */ |
| 179 isAsync: true, | 152 isAsync: true, |
| 180 | 153 |
| 181 /** @override */ | 154 /** @override */ |
| 182 testGenPreamble: function() { | 155 testGenPreamble: function() { |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 313 |
| 341 ExtensionOptionsDialogWebUITest.prototype = { | 314 ExtensionOptionsDialogWebUITest.prototype = { |
| 342 __proto__: InstalledExtensionSettingsWebUITest.prototype, | 315 __proto__: InstalledExtensionSettingsWebUITest.prototype, |
| 343 | 316 |
| 344 /** @override */ | 317 /** @override */ |
| 345 browsePreload: ExtensionSettingsWebUITest.prototype.browsePreload + | 318 browsePreload: ExtensionSettingsWebUITest.prototype.browsePreload + |
| 346 '?options=' + GOOD_CRX_ID, | 319 '?options=' + GOOD_CRX_ID, |
| 347 }; | 320 }; |
| 348 | 321 |
| 349 TEST_F('ExtensionOptionsDialogWebUITest', 'testAccessibility', runAudit); | 322 TEST_F('ExtensionOptionsDialogWebUITest', 'testAccessibility', runAudit); |
| OLD | NEW |