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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
264 assertFalse($('extension-list-wrapper').hidden); | 264 assertFalse($('extension-list-wrapper').hidden); |
265 assertTrue($('no-extensions').hidden); | 265 assertTrue($('no-extensions').hidden); |
266 assertGT($('extension-settings-list').childNodes.length, 0); | 266 assertGT($('extension-settings-list').childNodes.length, 0); |
267 this.nextStep(); | 267 this.nextStep(); |
268 }; | 268 }; |
269 | 269 |
270 this.steps = [this.waitForPageLoad, verifyListIsNotHiddenAndEmpty, testDone]; | 270 this.steps = [this.waitForPageLoad, verifyListIsNotHiddenAndEmpty, testDone]; |
271 this.nextStep(); | 271 this.nextStep(); |
272 }); | 272 }); |
273 | 273 |
274 function AsyncExtensionSettingsWebUITest() {} | 274 function DisableErrorButtonExtensionSettingsWebUITest() {} |
275 | 275 |
276 AsyncExtensionSettingsWebUITest.prototype = { | 276 DisableErrorButtonExtensionSettingsWebUITest.prototype = { |
277 __proto__: ExtensionSettingsWebUITest.prototype, | 277 __proto__: ExtensionSettingsWebUITest.prototype, |
278 | 278 |
279 /** @override */ | 279 /** @override */ |
280 testGenPreamble: function() { | 280 testGenPreamble: function() { |
281 GEN(' DisableErrorConsole();'); | |
282 | |
281 GEN(' InstallGoodExtension();'); | 283 GEN(' InstallGoodExtension();'); |
282 GEN(' InstallErrorsExtension();'); | 284 GEN(' InstallErrorsExtension();'); |
283 }, | 285 }, |
284 }; | 286 }; |
285 | 287 |
286 // Still fails on CrWinClang tester. BUG=463245 | 288 TEST_F('DisableErrorButtonExtensionSettingsWebUITest', |
287 TEST_F('AsyncExtensionSettingsWebUITest', | 289 'errorListButtonsHiddenIfNotDev', function() { |
288 'DISABLED_testErrorListButtonVisibility', | |
289 function() { | |
290 var testButtonVisibility = function() { | 290 var testButtonVisibility = function() { |
291 var extensionList = $('extension-list-wrapper'); | 291 var extensionList = $('extension-list-wrapper'); |
292 | 292 |
293 // 2 extensions are loaded: | |
294 // The 'good' extension will have 0 errors. | |
295 // The 'bad' extension will have >3 manifest errors and <3 runtime errors. | |
296 // Both buttons should be hidden. | |
297 | |
298 var visibleButtons = extensionList.querySelectorAll( | |
299 '.errors-link:not([hidden])'); | |
300 expectEquals(0, visibleButtons.length); | |
301 | |
302 var hiddenButtons = extensionList.querySelectorAll('.errors-link[hidden]'); | |
303 expectEquals(2, hiddenButtons.length); | |
304 | |
305 this.nextStep(); | |
306 }; | |
307 | |
308 this.steps = [this.waitForPageLoad, | |
309 this.enableDeveloperMode, | |
310 testButtonVisibility, | |
311 testDone]; | |
312 this.nextStep(); | |
313 }); | |
314 | |
315 function EnableErrorButtonExtensionSettingsWebUITest() {} | |
316 | |
317 EnableErrorButtonExtensionSettingsWebUITest.prototype = { | |
318 __proto__: ExtensionSettingsWebUITest.prototype, | |
319 | |
320 /** @override */ | |
321 testGenPreamble: function() { | |
322 GEN(' EnableErrorConsole();'); | |
323 | |
324 GEN(' InstallGoodExtension();'); | |
325 GEN(' InstallErrorsExtension();'); | |
326 }, | |
327 }; | |
328 | |
329 TEST_F('EnableErrorButtonExtensionSettingsWebUITest', | |
330 'testErrorListButtonVisibility', function() { | |
331 var testButtonVisibility = function() { | |
332 var extensionList = $('extension-list-wrapper'); | |
333 | |
293 // 2 extensions are loaded: | 334 // 2 extensions are loaded: |
294 // The 'good' extension will have 0 errors wich means no error button. | 335 // The 'good' extension will have 0 errors wich means no error button. |
295 // The 'bad' extension will have >3 manifest errors and <3 runtime errors. | 336 // The 'bad' extension will have >3 manifest errors and <3 runtime errors. |
296 // This means there will be a single error button. | 337 // This means there will be a single error button. |
Devlin
2015/05/07 21:33:56
This seems weird to me. The number and type of er
hcarmona
2015/05/07 22:49:53
Comments were getting confusing: removed.
Updated
| |
297 var visibleButtons = extensionList.querySelectorAll( | 338 var visibleButtons = extensionList.querySelectorAll( |
298 '.errors-link:not([hidden])'); | 339 '.errors-link:not([hidden])'); |
299 expectEquals(1, visibleButtons.length); | 340 expectEquals(1, visibleButtons.length); |
300 | 341 |
301 var hiddenButtons = extensionList.querySelectorAll('.errors-link[hidden]'); | 342 var hiddenButtons = extensionList.querySelectorAll('.errors-link[hidden]'); |
302 expectEquals(1, hiddenButtons.length); | 343 expectEquals(1, hiddenButtons.length); |
303 | 344 |
304 this.nextStep(); | 345 this.nextStep(); |
305 }; | 346 }; |
306 | 347 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
412 | 453 |
413 /** @override */ | 454 /** @override */ |
414 browsePreload: ExtensionSettingsWebUITest.prototype.browsePreload + | 455 browsePreload: ExtensionSettingsWebUITest.prototype.browsePreload + |
415 '?options=' + GOOD_CRX_ID, | 456 '?options=' + GOOD_CRX_ID, |
416 }; | 457 }; |
417 | 458 |
418 TEST_F('OptionsDialogExtensionSettingsWebUITest', 'testAccessibility', | 459 TEST_F('OptionsDialogExtensionSettingsWebUITest', 'testAccessibility', |
419 function() { | 460 function() { |
420 this.emptyTestForAccessibility(); | 461 this.emptyTestForAccessibility(); |
421 }); | 462 }); |
OLD | NEW |