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..a0cef91ac2539ba7f7b3be7e80197964025dc034 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(); |
not at google - send to devlin
2015/04/29 22:03:31
Should probably re-enable these in tearDown?
hcarmona
2015/04/30 18:42:00
These are disabled by injecting CSS into the page.
not at google - send to devlin
2015/04/30 22:47:10
fair nuff. so long as each test reloads the page.
Dan Beam
2015/04/30 23:01:54
eh, might as well just remove it every time
hcarmona
2015/04/30 23:16:59
Done.
|
}, |
/** |
@@ -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,9 +283,7 @@ 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() { |
// 2 extensions are loaded: |
@@ -315,21 +293,23 @@ TEST_F('AsyncExtensionSettingsWebUITest', |
// 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); |
+ expectEquals(1, visibleButtons.length); |
// Visible buttons must be part of the focusRow. |
- assertTrue(visibleButtons[0].hasAttribute('column-type')); |
+ expectTrue(visibleButtons[0] && |
+ visibleButtons[0].hasAttribute('column-type')); |
var hiddenButtons = document.querySelectorAll( |
'.extension-error-list-show-more > a[hidden]'); |
- assertEquals(1, hiddenButtons.length); |
+ expectEquals(1, hiddenButtons.length); |
// Hidden buttons must NOT be part of the focusRow. |
- assertFalse(hiddenButtons[0].hasAttribute('column-type')); |
+ expectFalse(hiddenButtons[0] && |
+ hiddenButtons[0].hasAttribute('column-type')); |
this.nextStep(); |
}; |
this.steps = [this.waitForPageLoad, |
- this.verifyDeveloperModeWorks, |
+ this.enableDeveloperMode, |
testButtonVisibility, |
testDone]; |
this.nextStep(); |