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 // The id of the extension from |InstallGoodExtension|. | 10 // The id of the extension from |InstallGoodExtension|. |
(...skipping 26 matching lines...) Expand all Loading... |
37 runAccessibilityChecks: true, | 37 runAccessibilityChecks: true, |
38 | 38 |
39 /** @override */ | 39 /** @override */ |
40 accessibilityIssuesAreErrors: true, | 40 accessibilityIssuesAreErrors: true, |
41 | 41 |
42 /** | 42 /** |
43 * A URL to load before starting each test. | 43 * A URL to load before starting each test. |
44 * @type {string} | 44 * @type {string} |
45 * @const | 45 * @const |
46 */ | 46 */ |
47 browsePreload: 'chrome://extensions-frame/', | 47 browsePreload: 'chrome://extensions/', |
48 | 48 |
49 /** @override */ | 49 /** @override */ |
50 typedefCppFixture: 'ExtensionSettingsUIBrowserTest', | 50 typedefCppFixture: 'ExtensionSettingsUIBrowserTest', |
51 | 51 |
52 /** @override */ | 52 /** @override */ |
53 setUp: function() { | 53 setUp: function() { |
54 testing.Test.prototype.setUp.call(this); | 54 testing.Test.prototype.setUp.call(this); |
55 testing.Test.disableAnimationsAndTransitions(); | 55 testing.Test.disableAnimationsAndTransitions(); |
56 | 56 |
57 // Enable when failure is resolved. | 57 // Enable when failure is resolved. |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 /** | 292 /** |
293 * A variation for testing auto-scroll when an id query param is passed in the | 293 * A variation for testing auto-scroll when an id query param is passed in the |
294 * url. | 294 * url. |
295 * @constructor | 295 * @constructor |
296 * @extends {BasicExtensionSettingsWebUITest} | 296 * @extends {BasicExtensionSettingsWebUITest} |
297 */ | 297 */ |
298 AutoScrollExtensionSettingsWebUITest.prototype = { | 298 AutoScrollExtensionSettingsWebUITest.prototype = { |
299 __proto__: BasicExtensionSettingsWebUITest.prototype, | 299 __proto__: BasicExtensionSettingsWebUITest.prototype, |
300 | 300 |
301 /** @override */ | 301 /** @override */ |
302 browsePreload: 'chrome://extensions-frame/?id=' + GOOD_EXTENSION_ID, | 302 browsePreload: 'chrome://extensions/?id=' + GOOD_EXTENSION_ID, |
303 | 303 |
304 /** @override */ | 304 /** @override */ |
305 testGenPreamble: function() { | 305 testGenPreamble: function() { |
306 BasicExtensionSettingsWebUITest.prototype.testGenPreamble.call(this); | 306 BasicExtensionSettingsWebUITest.prototype.testGenPreamble.call(this); |
307 // The window needs to be sufficiently small in order to ensure a scroll bar | 307 // The window needs to be sufficiently small in order to ensure a scroll bar |
308 // is available. | 308 // is available. |
309 GEN(' ShrinkWebContentsView();'); | 309 GEN(' ShrinkWebContentsView();'); |
310 }, | 310 }, |
311 }; | 311 }; |
312 | 312 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 function SettingsCommandsExtensionSettingsWebUITest() {} | 391 function SettingsCommandsExtensionSettingsWebUITest() {} |
392 | 392 |
393 SettingsCommandsExtensionSettingsWebUITest.prototype = { | 393 SettingsCommandsExtensionSettingsWebUITest.prototype = { |
394 __proto__: ExtensionSettingsWebUITest.prototype, | 394 __proto__: ExtensionSettingsWebUITest.prototype, |
395 | 395 |
396 /** | 396 /** |
397 * A URL to load before starting each test. | 397 * A URL to load before starting each test. |
398 * @type {string} | 398 * @type {string} |
399 * @const | 399 * @const |
400 */ | 400 */ |
401 browsePreload: 'chrome://extensions-frame/configureCommands', | 401 browsePreload: 'chrome://extensions/configureCommands', |
402 }; | 402 }; |
403 | 403 |
404 TEST_F('SettingsCommandsExtensionSettingsWebUITest', 'testChromeSendHandler', | 404 TEST_F('SettingsCommandsExtensionSettingsWebUITest', 'testChromeSendHandler', |
405 function() { | 405 function() { |
406 // Just navigating to the page should trigger the chrome.send(). | 406 // Just navigating to the page should trigger the chrome.send(). |
407 var assertOverlayVisible = function() { | 407 var assertOverlayVisible = function() { |
408 assertTrue($('extension-commands-overlay').classList.contains('showing')); | 408 assertTrue($('extension-commands-overlay').classList.contains('showing')); |
409 assertEquals($('extension-commands-overlay').getAttribute('aria-hidden'), | 409 assertEquals($('extension-commands-overlay').getAttribute('aria-hidden'), |
410 'false'); | 410 'false'); |
411 this.nextStep(); | 411 this.nextStep(); |
412 }; | 412 }; |
413 | 413 |
414 this.steps = [this.waitForPageLoad, assertOverlayVisible, testDone]; | 414 this.steps = [this.waitForPageLoad, assertOverlayVisible, testDone]; |
415 this.nextStep(); | 415 this.nextStep(); |
416 }); | 416 }); |
417 | 417 |
418 TEST_F('SettingsCommandsExtensionSettingsWebUITest', 'extensionSettingsUri', | 418 TEST_F('SettingsCommandsExtensionSettingsWebUITest', 'extensionSettingsUri', |
419 function() { | 419 function() { |
420 var closeCommandOverlay = function() { | 420 var closeCommandOverlay = function() { |
421 assertTrue($('extension-commands-overlay').classList.contains('showing')); | 421 assertTrue($('extension-commands-overlay').classList.contains('showing')); |
422 assertEquals($('extension-commands-overlay').getAttribute('aria-hidden'), | 422 assertEquals($('extension-commands-overlay').getAttribute('aria-hidden'), |
423 'false'); | 423 'false'); |
424 assertEquals(window.location.href, | 424 assertEquals(window.location.href, 'chrome://extensions/configureCommands'); |
425 'chrome://extensions-frame/configureCommands'); | |
426 | 425 |
427 // Close command overlay. | 426 // Close command overlay. |
428 $('extension-commands-dismiss').click(); | 427 $('extension-commands-dismiss').click(); |
429 | 428 |
430 assertFalse($('extension-commands-overlay').classList.contains('showing')); | 429 assertFalse($('extension-commands-overlay').classList.contains('showing')); |
431 assertEquals($('extension-commands-overlay').getAttribute('aria-hidden'), | 430 assertEquals($('extension-commands-overlay').getAttribute('aria-hidden'), |
432 'true'); | 431 'true'); |
433 this.nextStep(); | 432 this.nextStep(); |
434 }; | 433 }; |
435 | 434 |
436 var checkExtensionsUrl = function() { | 435 var checkExtensionsUrl = function() { |
437 // After closing the overlay, the URL shouldn't include commands overlay | 436 // After closing the overlay, the URL shouldn't include commands overlay |
438 // reference. | 437 // reference. |
439 assertEquals(window.location.href, 'chrome://extensions-frame/'); | 438 assertEquals(window.location.href, 'chrome://extensions/'); |
440 this.nextStep(); | 439 this.nextStep(); |
441 }; | 440 }; |
442 | 441 |
443 this.steps = [this.waitForPageLoad, | 442 this.steps = [this.waitForPageLoad, |
444 closeCommandOverlay, | 443 closeCommandOverlay, |
445 checkExtensionsUrl, | 444 checkExtensionsUrl, |
446 testDone]; | 445 testDone]; |
447 this.nextStep(); | 446 this.nextStep(); |
448 }); | 447 }); |
449 | 448 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 | 517 |
519 /** @override */ | 518 /** @override */ |
520 browsePreload: ExtensionSettingsWebUITest.prototype.browsePreload + | 519 browsePreload: ExtensionSettingsWebUITest.prototype.browsePreload + |
521 '?options=' + GOOD_EXTENSION_ID, | 520 '?options=' + GOOD_EXTENSION_ID, |
522 }; | 521 }; |
523 | 522 |
524 TEST_F('OptionsDialogExtensionSettingsWebUITest', 'testAccessibility', | 523 TEST_F('OptionsDialogExtensionSettingsWebUITest', 'testAccessibility', |
525 function() { | 524 function() { |
526 this.emptyTestForAccessibility(); | 525 this.emptyTestForAccessibility(); |
527 }); | 526 }); |
OLD | NEW |