Chromium Code Reviews| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 * @protected | 81 * @protected |
| 82 * */ | 82 * */ |
| 83 waitForPageLoad: function() { | 83 waitForPageLoad: function() { |
| 84 assertEquals(this.browsePreload, document.location.href); | 84 assertEquals(this.browsePreload, document.location.href); |
| 85 var extensionList = getRequiredElement('extension-settings-list'); | 85 var extensionList = getRequiredElement('extension-settings-list'); |
| 86 extensionList.loadFinished.then(this.nextStep.bind(this)); | 86 extensionList.loadFinished.then(this.nextStep.bind(this)); |
| 87 }, | 87 }, |
| 88 | 88 |
| 89 /** @protected */ | 89 /** @protected */ |
| 90 verifyDeveloperModeWorks: function() { | 90 verifyDeveloperModeWorks: function() { |
| 91 this.ignoreDevModeA11yFailures(); | |
| 91 var extensionSettings = getRequiredElement('extension-settings'); | 92 var extensionSettings = getRequiredElement('extension-settings'); |
| 92 assertFalse(extensionSettings.classList.contains('dev-mode')); | 93 assertFalse(extensionSettings.classList.contains('dev-mode')); |
| 93 $('toggle-dev-on').click(); | 94 $('toggle-dev-on').click(); |
| 94 assertTrue(extensionSettings.classList.contains('dev-mode')); | 95 assertTrue(extensionSettings.classList.contains('dev-mode')); |
| 95 chrome.developerPrivate.getProfileConfiguration(function(profileInfo) { | 96 chrome.developerPrivate.getProfileConfiguration(function(profileInfo) { |
| 96 assertTrue(profileInfo.inDeveloperMode); | 97 assertTrue(profileInfo.inDeveloperMode); |
| 97 | 98 |
| 98 // A 0ms timeout is necessary so that all the transitions can finish. | 99 // A 0ms timeout is necessary so that all the transitions can finish. |
| 99 window.setTimeout(this.nextStep.bind(this), 0); | 100 window.setTimeout(this.nextStep.bind(this), 0); |
| 100 }.bind(this)); | 101 }.bind(this)); |
| 101 }, | 102 }, |
| 102 | 103 |
| 103 /** @protected */ | 104 /** @protected */ |
| 104 testDeveloperMode: function() { | 105 testDeveloperMode: function() { |
| 105 var next = this.nextStep.bind(this); | 106 var next = this.nextStep.bind(this); |
| 106 var checkDevModeIsOff = function() { | 107 var checkDevModeIsOff = function() { |
| 107 chrome.developerPrivate.getProfileConfiguration(function(profileInfo) { | 108 chrome.developerPrivate.getProfileConfiguration(function(profileInfo) { |
| 108 assertFalse(profileInfo.inDeveloperMode); | 109 assertFalse(profileInfo.inDeveloperMode); |
| 109 next(); | 110 next(); |
| 110 }); | 111 }); |
| 111 }; | 112 }; |
| 112 this.steps = [this.waitForPageLoad, | 113 this.steps = [this.waitForPageLoad, |
| 113 checkDevModeIsOff, | 114 checkDevModeIsOff, |
| 114 this.verifyDeveloperModeWorks, | 115 this.verifyDeveloperModeWorks, |
| 115 testDone]; | 116 testDone]; |
| 116 this.nextStep(); | 117 this.nextStep(); |
| 117 } | 118 }, |
| 119 | |
| 120 /** | |
| 121 * TODO(hcarmona): Remove this as part of fixing crbug.com/463245. | |
| 122 * Will ignore accessibility failures caused by the transition when developer | |
| 123 * mode is enabled. | |
|
Devlin
2015/04/27 15:49:24
nit: I'd comment on why we ignore it, and why it's
| |
| 124 * @protected | |
| 125 */ | |
| 126 ignoreDevModeA11yFailures: function() { | |
| 127 this.accessibilityAuditConfig.ignoreSelectors( | |
| 128 'focusableElementNotVisibleAndNotAriaHidden', | |
| 129 '#load-unpacked'); | |
| 130 this.accessibilityAuditConfig.ignoreSelectors( | |
| 131 'focusableElementNotVisibleAndNotAriaHidden', | |
| 132 '#pack-extension'); | |
| 133 this.accessibilityAuditConfig.ignoreSelectors( | |
| 134 'focusableElementNotVisibleAndNotAriaHidden', | |
| 135 '#update-extensions-now'); | |
| 136 }, | |
| 118 }; | 137 }; |
| 119 | 138 |
| 120 // Verify that developer mode doesn't change behavior when the number of | 139 // Verify that developer mode doesn't change behavior when the number of |
| 121 // extensions changes. | 140 // extensions changes. |
| 122 TEST_F('ExtensionSettingsWebUITest', 'testDeveloperModeNoExtensions', | 141 TEST_F('ExtensionSettingsWebUITest', 'testDeveloperModeNoExtensions', |
| 123 function() { | 142 function() { |
| 124 this.testDeveloperMode(); | 143 this.testDeveloperMode(); |
| 125 }); | 144 }); |
| 126 | 145 |
| 127 TEST_F('ExtensionSettingsWebUITest', 'testEmptyExtensionList', function() { | 146 TEST_F('ExtensionSettingsWebUITest', 'testEmptyExtensionList', function() { |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 383 | 402 |
| 384 /** @override */ | 403 /** @override */ |
| 385 browsePreload: ExtensionSettingsWebUITest.prototype.browsePreload + | 404 browsePreload: ExtensionSettingsWebUITest.prototype.browsePreload + |
| 386 '?options=' + GOOD_CRX_ID, | 405 '?options=' + GOOD_CRX_ID, |
| 387 }; | 406 }; |
| 388 | 407 |
| 389 TEST_F('OptionsDialogExtensionSettingsWebUITest', 'testAccessibility', | 408 TEST_F('OptionsDialogExtensionSettingsWebUITest', 'testAccessibility', |
| 390 function() { | 409 function() { |
| 391 this.emptyTestForAccessibility(); | 410 this.emptyTestForAccessibility(); |
| 392 }); | 411 }); |
| OLD | NEW |