| 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 GEN_INCLUDE(['options_browsertest_base.js']); | 5 GEN_INCLUDE(['options_browsertest_base.js']); |
| 6 GEN('#include "chrome/browser/ui/webui/options/options_browsertest.h"'); | 6 GEN('#include "chrome/browser/ui/webui/options/options_browsertest.h"'); |
| 7 | 7 |
| 8 /** @const */ var SUPERVISED_USERS_PREF = 'profile.managed_users'; | 8 /** @const */ var SUPERVISED_USERS_PREF = 'profile.managed_users'; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 'clearPref', | 72 'clearPref', |
| 73 'coreOptionsUserMetricsAction', | 73 'coreOptionsUserMetricsAction', |
| 74 ]); | 74 ]); |
| 75 | 75 |
| 76 // Register stubs for methods expected to be called before/during tests. | 76 // Register stubs for methods expected to be called before/during tests. |
| 77 // Specific expectations can be made in the tests themselves. | 77 // Specific expectations can be made in the tests themselves. |
| 78 this.mockHandler.stubs().fetchPrefs(ANYTHING); | 78 this.mockHandler.stubs().fetchPrefs(ANYTHING); |
| 79 this.mockHandler.stubs().observePrefs(ANYTHING); | 79 this.mockHandler.stubs().observePrefs(ANYTHING); |
| 80 this.mockHandler.stubs().coreOptionsUserMetricsAction(ANYTHING); | 80 this.mockHandler.stubs().coreOptionsUserMetricsAction(ANYTHING); |
| 81 }, | 81 }, |
| 82 | |
| 83 /** @override */ | |
| 84 setUp: function() { | |
| 85 OptionsBrowsertestBase.prototype.setUp.call(this); | |
| 86 | |
| 87 // Enable when failure is resolved. | |
| 88 // AX_ARIA_10: http://crbug.com/559329 | |
| 89 this.accessibilityAuditConfig.ignoreSelectors( | |
| 90 'unsupportedAriaAttribute', | |
| 91 '#profiles-list'); | |
| 92 | |
| 93 var linkWithUnclearPurposeSelectors = [ | |
| 94 '#sync-overview > A', | |
| 95 '#privacy-explanation > A', | |
| 96 '#languages-section > .settings-row > A', | |
| 97 '#cloudprint-options-mdns > .settings-row > A', | |
| 98 '#do-not-track-confirm-overlay > .action-area > .hbox.stretch > A', | |
| 99 ]; | |
| 100 | |
| 101 // Enable when failure is resolved. | |
| 102 // AX_TEXT_04: http://crbug.com/559318 | |
| 103 this.accessibilityAuditConfig.ignoreSelectors( | |
| 104 'linkWithUnclearPurpose', | |
| 105 linkWithUnclearPurposeSelectors); | |
| 106 }, | |
| 107 }; | 82 }; |
| 108 | 83 |
| 109 /** | 84 /** |
| 110 * Wait for all targets to be hidden. | 85 * Wait for all targets to be hidden. |
| 111 * @param {Array<Element>} targets | 86 * @param {Array<Element>} targets |
| 112 */ | 87 */ |
| 113 function waitUntilHidden(targets) { | 88 function waitUntilHidden(targets) { |
| 114 function isHidden(el) { return el.hidden; } | 89 function isHidden(el) { return el.hidden; } |
| 115 function ensureTransition(el) { ensureTransitionEndEvent(el, 500); } | 90 function ensureTransition(el) { ensureTransitionEndEvent(el, 500); } |
| 116 | 91 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 * @constructor | 371 * @constructor |
| 397 */ | 372 */ |
| 398 function OptionsWebUIExtendedTest() {} | 373 function OptionsWebUIExtendedTest() {} |
| 399 | 374 |
| 400 OptionsWebUIExtendedTest.prototype = { | 375 OptionsWebUIExtendedTest.prototype = { |
| 401 __proto__: OptionsWebUITest.prototype, | 376 __proto__: OptionsWebUITest.prototype, |
| 402 | 377 |
| 403 /** @override */ | 378 /** @override */ |
| 404 typedefCppFixture: 'OptionsBrowserTest', | 379 typedefCppFixture: 'OptionsBrowserTest', |
| 405 | 380 |
| 406 /** @override */ | |
| 407 setUp: function() { | |
| 408 OptionsWebUITest.prototype.setUp.call(this); | |
| 409 | |
| 410 // Enable when failure is resolved. | |
| 411 // AX_ARIA_10: http://crbug.com/559329 | |
| 412 this.accessibilityAuditConfig.ignoreSelectors( | |
| 413 'unsupportedAriaAttribute', | |
| 414 '#profiles-list'); | |
| 415 | |
| 416 var controlsWithoutLabelSelectors = [ | |
| 417 '#cookies-view-page > .content-area.cookies-list-content-area > *', | |
| 418 '#other-search-engine-list > .deletable-item > DIV > *', | |
| 419 ]; | |
| 420 | |
| 421 // Enable when failure is resolved. | |
| 422 // AX_TEXT_01: http://crbug.com/559330 | |
| 423 this.accessibilityAuditConfig.ignoreSelectors( | |
| 424 'controlsWithoutLabel', | |
| 425 controlsWithoutLabelSelectors); | |
| 426 | |
| 427 var linkWithUnclearPurposeSelectors = [ | |
| 428 '#sync-overview > A', | |
| 429 '#privacy-explanation > A', | |
| 430 '#languages-section > .settings-row > A', | |
| 431 '#cloudprint-options-mdns > .settings-row > A', | |
| 432 // Selectors below only affect ChromeOS tests. | |
| 433 '#privacy-section > DIV > DIV:nth-of-type(9) > A', | |
| 434 '#accessibility-learn-more', | |
| 435 ]; | |
| 436 | |
| 437 // Enable when failure is resolved. | |
| 438 // AX_TEXT_04: http://crbug.com/559326 | |
| 439 this.accessibilityAuditConfig.ignoreSelectors( | |
| 440 'linkWithUnclearPurpose', | |
| 441 linkWithUnclearPurposeSelectors); | |
| 442 }, | |
| 443 | |
| 444 testGenPreamble: function() { | 381 testGenPreamble: function() { |
| 445 // Start with no supervised users managed by this profile. | 382 // Start with no supervised users managed by this profile. |
| 446 GEN(' ClearPref("' + SUPERVISED_USERS_PREF + '");'); | 383 GEN(' ClearPref("' + SUPERVISED_USERS_PREF + '");'); |
| 447 }, | 384 }, |
| 448 | 385 |
| 449 /** | 386 /** |
| 450 * Asserts that two non-nested arrays are equal. The arrays must contain only | 387 * Asserts that two non-nested arrays are equal. The arrays must contain only |
| 451 * plain data types, no nested arrays or other objects. | 388 * plain data types, no nested arrays or other objects. |
| 452 * @param {Array} expected An array of expected values. | 389 * @param {Array} expected An array of expected values. |
| 453 * @param {Array} result An array of actual values. | 390 * @param {Array} result An array of actual values. |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 __proto__: OptionsWebUIExtendedTest.prototype, | 872 __proto__: OptionsWebUIExtendedTest.prototype, |
| 936 | 873 |
| 937 /** @override */ | 874 /** @override */ |
| 938 browsePreload: 'chrome://settings-frame/nonexistantPage', | 875 browsePreload: 'chrome://settings-frame/nonexistantPage', |
| 939 }; | 876 }; |
| 940 | 877 |
| 941 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { | 878 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { |
| 942 assertEquals('chrome://settings-frame/', document.location.href); | 879 assertEquals('chrome://settings-frame/', document.location.href); |
| 943 this.verifyHistory_([''], testDone); | 880 this.verifyHistory_([''], testDone); |
| 944 }); | 881 }); |
| OLD | NEW |