| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 * @type {string} | 42 * @type {string} |
| 43 * @const | 43 * @const |
| 44 */ | 44 */ |
| 45 browsePreload: 'chrome://extensions-frame/', | 45 browsePreload: 'chrome://extensions-frame/', |
| 46 | 46 |
| 47 /** @override */ | 47 /** @override */ |
| 48 typedefCppFixture: 'ExtensionSettingsUIBrowserTest', | 48 typedefCppFixture: 'ExtensionSettingsUIBrowserTest', |
| 49 | 49 |
| 50 /** @override */ | 50 /** @override */ |
| 51 setUp: function() { | 51 setUp: function() { |
| 52 // Make all transitions take 0ms for testing purposes. | 52 this.disableAnimationsAndTransitions(); |
| 53 var noTransitionStyle = document.createElement('style'); | |
| 54 noTransitionStyle.textContent = | |
| 55 '* {' + | |
| 56 ' -webkit-transition-duration: 0ms !important;' + | |
| 57 ' -webkit-transition-delay: 0ms !important;' + | |
| 58 '}'; | |
| 59 document.querySelector('head').appendChild(noTransitionStyle); | |
| 60 }, | 53 }, |
| 61 | 54 |
| 62 /** | 55 /** |
| 63 * Holds an array of steps that should happen in order during a test. | 56 * Holds an array of steps that should happen in order during a test. |
| 64 * The last step should be |testDone|. | 57 * The last step should be |testDone|. |
| 65 * @protected {Array<!Function>} | 58 * @protected {Array<!Function>} |
| 66 * */ | 59 * */ |
| 67 steps: [], | 60 steps: [], |
| 68 | 61 |
| 69 /** | 62 /** |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 chrome.developerPrivate.getProfileConfiguration(function(profileInfo) { | 100 chrome.developerPrivate.getProfileConfiguration(function(profileInfo) { |
| 108 assertFalse(profileInfo.inDeveloperMode); | 101 assertFalse(profileInfo.inDeveloperMode); |
| 109 next(); | 102 next(); |
| 110 }); | 103 }); |
| 111 }; | 104 }; |
| 112 this.steps = [this.waitForPageLoad, | 105 this.steps = [this.waitForPageLoad, |
| 113 checkDevModeIsOff, | 106 checkDevModeIsOff, |
| 114 this.verifyDeveloperModeWorks, | 107 this.verifyDeveloperModeWorks, |
| 115 testDone]; | 108 testDone]; |
| 116 this.nextStep(); | 109 this.nextStep(); |
| 117 } | 110 }, |
| 118 }; | 111 }; |
| 119 | 112 |
| 120 // Verify that developer mode doesn't change behavior when the number of | 113 // Verify that developer mode doesn't change behavior when the number of |
| 121 // extensions changes. | 114 // extensions changes. |
| 122 TEST_F('ExtensionSettingsWebUITest', 'testDeveloperModeNoExtensions', | 115 TEST_F('ExtensionSettingsWebUITest', 'testDeveloperModeNoExtensions', |
| 123 function() { | 116 function() { |
| 124 this.testDeveloperMode(); | 117 this.testDeveloperMode(); |
| 125 }); | 118 }); |
| 126 | 119 |
| 127 TEST_F('ExtensionSettingsWebUITest', 'testEmptyExtensionList', function() { | 120 TEST_F('ExtensionSettingsWebUITest', 'testEmptyExtensionList', function() { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 __proto__: ExtensionSettingsWebUITest.prototype, | 237 __proto__: ExtensionSettingsWebUITest.prototype, |
| 245 | 238 |
| 246 /** @override */ | 239 /** @override */ |
| 247 testGenPreamble: function() { | 240 testGenPreamble: function() { |
| 248 GEN(' InstallGoodExtension();'); | 241 GEN(' InstallGoodExtension();'); |
| 249 GEN(' InstallErrorsExtension();'); | 242 GEN(' InstallErrorsExtension();'); |
| 250 }, | 243 }, |
| 251 }; | 244 }; |
| 252 | 245 |
| 253 // Often times out on all platforms: http://crbug.com/467528 | 246 // Often times out on all platforms: http://crbug.com/467528 |
| 254 TEST_F('AsyncExtensionSettingsWebUITest', | 247 TEST_F('AsyncExtensionSettingsWebUITest', 'testErrorListButtonVisibility', |
| 255 'DISABLED_testErrorListButtonVisibility', | |
| 256 function() { | 248 function() { |
| 257 var testButtonVisibility = function() { | 249 var testButtonVisibility = function() { |
| 258 // 2 extensions are loaded: | 250 // 2 extensions are loaded: |
| 259 // The 'good' extension will have 0 errors wich means no error list | 251 // The 'good' extension will have 0 errors wich means no error list |
| 260 // buttons. | 252 // buttons. |
| 261 // The 'bad' extension will have >3 manifest errors and <3 runtime errors. | 253 // The 'bad' extension will have >3 manifest errors and <3 runtime errors. |
| 262 // This means 2 buttons: 1 visible and 1 hidden. | 254 // This means 2 buttons: 1 visible and 1 hidden. |
| 263 var visibleButtons = document.querySelectorAll( | 255 var visibleButtons = document.querySelectorAll( |
| 264 '.extension-error-list-show-more > a:not([hidden])'); | 256 '.extension-error-list-show-more > a:not([hidden])'); |
| 265 assertEquals(1, visibleButtons.length); | 257 expectEquals(1, visibleButtons.length); |
| 266 // Visible buttons must be part of the focusRow. | 258 // Visible buttons must be part of the focusRow. |
| 267 assertTrue(visibleButtons[0].hasAttribute('column-type')); | 259 expectTrue(visibleButtons[0] && |
| 260 visibleButtons[0].hasAttribute('column-type')); |
| 268 | 261 |
| 269 var hiddenButtons = document.querySelectorAll( | 262 var hiddenButtons = document.querySelectorAll( |
| 270 '.extension-error-list-show-more > a[hidden]'); | 263 '.extension-error-list-show-more > a[hidden]'); |
| 271 assertEquals(1, hiddenButtons.length); | 264 expectEquals(1, hiddenButtons.length); |
| 272 // Hidden buttons must NOT be part of the focusRow. | 265 // Hidden buttons must NOT be part of the focusRow. |
| 273 assertFalse(hiddenButtons[0].hasAttribute('column-type')); | 266 expectFalse(hiddenButtons[0] && |
| 267 hiddenButtons[0].hasAttribute('column-type')); |
| 274 | 268 |
| 275 this.nextStep(); | 269 this.nextStep(); |
| 276 }; | 270 }; |
| 277 | 271 |
| 278 this.steps = [this.waitForPageLoad, | 272 this.steps = [this.waitForPageLoad, |
| 279 this.verifyDeveloperModeWorks, | 273 this.verifyDeveloperModeWorks, |
| 280 testButtonVisibility, | 274 testButtonVisibility, |
| 281 testDone]; | 275 testDone]; |
| 282 this.nextStep(); | 276 this.nextStep(); |
| 283 }); | 277 }); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 | 377 |
| 384 /** @override */ | 378 /** @override */ |
| 385 browsePreload: ExtensionSettingsWebUITest.prototype.browsePreload + | 379 browsePreload: ExtensionSettingsWebUITest.prototype.browsePreload + |
| 386 '?options=' + GOOD_CRX_ID, | 380 '?options=' + GOOD_CRX_ID, |
| 387 }; | 381 }; |
| 388 | 382 |
| 389 TEST_F('OptionsDialogExtensionSettingsWebUITest', 'testAccessibility', | 383 TEST_F('OptionsDialogExtensionSettingsWebUITest', 'testAccessibility', |
| 390 function() { | 384 function() { |
| 391 this.emptyTestForAccessibility(); | 385 this.emptyTestForAccessibility(); |
| 392 }); | 386 }); |
| OLD | NEW |