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 }, | |
82 }; | 107 }; |
83 | 108 |
84 /** | 109 /** |
85 * Wait for all targets to be hidden. | 110 * Wait for all targets to be hidden. |
86 * @param {Array<Element>} targets | 111 * @param {Array<Element>} targets |
87 */ | 112 */ |
88 function waitUntilHidden(targets) { | 113 function waitUntilHidden(targets) { |
89 function isHidden(el) { return el.hidden; } | 114 function isHidden(el) { return el.hidden; } |
90 function ensureTransition(el) { ensureTransitionEndEvent(el, 500); } | 115 function ensureTransition(el) { ensureTransitionEndEvent(el, 500); } |
91 | 116 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
371 * @constructor | 396 * @constructor |
372 */ | 397 */ |
373 function OptionsWebUIExtendedTest() {} | 398 function OptionsWebUIExtendedTest() {} |
374 | 399 |
375 OptionsWebUIExtendedTest.prototype = { | 400 OptionsWebUIExtendedTest.prototype = { |
376 __proto__: OptionsWebUITest.prototype, | 401 __proto__: OptionsWebUITest.prototype, |
377 | 402 |
378 /** @override */ | 403 /** @override */ |
379 typedefCppFixture: 'OptionsBrowserTest', | 404 typedefCppFixture: 'OptionsBrowserTest', |
380 | 405 |
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 | |
Dan Beam
2015/11/24 23:24:26
remove extra newline
apacible
2015/11/25 19:13:53
Done.
| |
428 var linkWithUnclearPurposeSelectors = [ | |
429 '#sync-overview > A', | |
430 '#privacy-explanation > A', | |
431 '#languages-section > .settings-row > A', | |
432 '#cloudprint-options-mdns > .settings-row > A', | |
433 // Selectors below only affect ChromeOS tests. | |
434 '#privacy-section > DIV > DIV:nth-of-type(9) > A', | |
435 '#accessibility-learn-more', | |
436 ]; | |
437 | |
438 // Enable when failure is resolved. | |
439 // AX_TEXT_04: http://crbug.com/559326 | |
440 this.accessibilityAuditConfig.ignoreSelectors( | |
441 'linkWithUnclearPurpose', | |
442 linkWithUnclearPurposeSelectors); | |
443 }, | |
444 | |
381 testGenPreamble: function() { | 445 testGenPreamble: function() { |
382 // Start with no supervised users managed by this profile. | 446 // Start with no supervised users managed by this profile. |
383 GEN(' ClearPref("' + SUPERVISED_USERS_PREF + '");'); | 447 GEN(' ClearPref("' + SUPERVISED_USERS_PREF + '");'); |
384 }, | 448 }, |
385 | 449 |
386 /** | 450 /** |
387 * Asserts that two non-nested arrays are equal. The arrays must contain only | 451 * Asserts that two non-nested arrays are equal. The arrays must contain only |
388 * plain data types, no nested arrays or other objects. | 452 * plain data types, no nested arrays or other objects. |
389 * @param {Array} expected An array of expected values. | 453 * @param {Array} expected An array of expected values. |
390 * @param {Array} result An array of actual values. | 454 * @param {Array} result An array of actual values. |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
872 __proto__: OptionsWebUIExtendedTest.prototype, | 936 __proto__: OptionsWebUIExtendedTest.prototype, |
873 | 937 |
874 /** @override */ | 938 /** @override */ |
875 browsePreload: 'chrome://settings-frame/nonexistantPage', | 939 browsePreload: 'chrome://settings-frame/nonexistantPage', |
876 }; | 940 }; |
877 | 941 |
878 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { | 942 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { |
879 assertEquals('chrome://settings-frame/', document.location.href); | 943 assertEquals('chrome://settings-frame/', document.location.href); |
880 this.verifyHistory_([''], testDone); | 944 this.verifyHistory_([''], testDone); |
881 }); | 945 }); |
OLD | NEW |