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 3fdd656a6686c1b34dbbd6700ee436c706da4871..969572ec0bd8330286de133156bfd646306d06ff 100644 |
--- a/chrome/browser/ui/webui/extensions/extension_settings_browsertest.js |
+++ b/chrome/browser/ui/webui/extensions/extension_settings_browsertest.js |
@@ -49,14 +49,7 @@ ExtensionSettingsWebUITest.prototype = { |
/** @override */ |
setUp: function() { |
- // Make all transitions take 0ms for testing purposes. |
- var noTransitionStyle = document.createElement('style'); |
- noTransitionStyle.textContent = |
- '* {' + |
- ' -webkit-transition-duration: 0ms !important;' + |
- ' -webkit-transition-delay: 0ms !important;' + |
- '}'; |
- document.querySelector('head').appendChild(noTransitionStyle); |
+ testing.Test.disableAnimationsAndTransitions(); |
}, |
/** |
@@ -87,18 +80,24 @@ ExtensionSettingsWebUITest.prototype = { |
}, |
/** @protected */ |
- verifyDeveloperModeWorks: function() { |
- this.ignoreDevModeA11yFailures(); |
+ enableDeveloperMode: function() { |
+ var next = this.nextStep.bind(this); |
+ extensions.ExtensionSettings.getInstance().testingDeveloperModeCallback = |
+ function() { |
+ chrome.developerPrivate.getProfileConfiguration(function(profileInfo) { |
+ assertTrue(extensionSettings.classList.contains('dev-mode')); |
+ assertTrue(profileInfo.inDeveloperMode); |
+ next(); |
+ |
+ // This event isn't thrown because transitions are disabled. |
+ // Ensure transition here so that any dependent code does not break. |
+ ensureTransitionEndEvent($('dev-controls'), 0); |
+ }); |
+ }; |
+ |
var extensionSettings = getRequiredElement('extension-settings'); |
assertFalse(extensionSettings.classList.contains('dev-mode')); |
$('toggle-dev-on').click(); |
- assertTrue(extensionSettings.classList.contains('dev-mode')); |
- chrome.developerPrivate.getProfileConfiguration(function(profileInfo) { |
- assertTrue(profileInfo.inDeveloperMode); |
- |
- // A 0ms timeout is necessary so that all the transitions can finish. |
- window.setTimeout(this.nextStep.bind(this), 0); |
- }.bind(this)); |
}, |
/** @protected */ |
@@ -112,28 +111,10 @@ ExtensionSettingsWebUITest.prototype = { |
}; |
this.steps = [this.waitForPageLoad, |
checkDevModeIsOff, |
- this.verifyDeveloperModeWorks, |
+ this.enableDeveloperMode, |
testDone]; |
this.nextStep(); |
}, |
- |
- /** |
- * TODO(hcarmona): Remove this as part of fixing crbug.com/463245. |
- * Will ignore accessibility failures caused by the transition when developer |
- * mode is enabled. |
- * @protected |
- */ |
- ignoreDevModeA11yFailures: function() { |
- this.accessibilityAuditConfig.ignoreSelectors( |
- 'focusableElementNotVisibleAndNotAriaHidden', |
- '#load-unpacked'); |
- this.accessibilityAuditConfig.ignoreSelectors( |
- 'focusableElementNotVisibleAndNotAriaHidden', |
- '#pack-extension'); |
- this.accessibilityAuditConfig.ignoreSelectors( |
- 'focusableElementNotVisibleAndNotAriaHidden', |
- '#update-extensions-now'); |
- }, |
}; |
// Verify that developer mode doesn't change behavior when the number of |
@@ -283,7 +264,6 @@ TEST_F('BasicExtensionSettingsWebUITest', 'testNonEmptyExtensionList', |
assertFalse($('extension-list-wrapper').hidden); |
assertTrue($('no-extensions').hidden); |
assertGT($('extension-settings-list').childNodes.length, 0); |
- |
this.nextStep(); |
}; |
@@ -303,33 +283,27 @@ AsyncExtensionSettingsWebUITest.prototype = { |
}, |
}; |
-// Often times out on all platforms: http://crbug.com/467528 |
-TEST_F('AsyncExtensionSettingsWebUITest', |
- 'DISABLED_testErrorListButtonVisibility', |
+TEST_F('AsyncExtensionSettingsWebUITest', 'testErrorListButtonVisibility', |
function() { |
var testButtonVisibility = function() { |
+ var extensionList = $('extension-list-wrapper'); |
+ |
// 2 extensions are loaded: |
- // The 'good' extension will have 0 errors wich means no error list |
- // buttons. |
+ // The 'good' extension will have 0 errors wich means no error button. |
// The 'bad' extension will have >3 manifest errors and <3 runtime errors. |
- // This means 2 buttons: 1 visible and 1 hidden. |
- var visibleButtons = document.querySelectorAll( |
- '.extension-error-list-show-more > a:not([hidden])'); |
- assertEquals(1, visibleButtons.length); |
- // Visible buttons must be part of the focusRow. |
- assertTrue(visibleButtons[0].hasAttribute('column-type')); |
- |
- var hiddenButtons = document.querySelectorAll( |
- '.extension-error-list-show-more > a[hidden]'); |
- assertEquals(1, hiddenButtons.length); |
- // Hidden buttons must NOT be part of the focusRow. |
- assertFalse(hiddenButtons[0].hasAttribute('column-type')); |
+ // This means there will be a single error button. |
+ var visibleButtons = extensionList.querySelectorAll( |
+ '.errors-link:not([hidden])'); |
+ expectEquals(1, visibleButtons.length); |
+ |
+ var hiddenButtons = extensionList.querySelectorAll('.errors-link[hidden]'); |
+ expectEquals(1, hiddenButtons.length); |
this.nextStep(); |
}; |
this.steps = [this.waitForPageLoad, |
- this.verifyDeveloperModeWorks, |
+ this.enableDeveloperMode, |
testButtonVisibility, |
testDone]; |
this.nextStep(); |