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 linkWithUnclearPurposeSelectors.forEach(function(selector) { | |
104 this.accessibilityAuditConfig.ignoreSelectors( | |
aboxhall
2015/11/20 23:50:06
You should be able to pass linkWithUnclearPurposeS
apacible
2015/11/21 01:29:56
Done.
| |
105 'linkWithUnclearPurpose', | |
106 selector); | |
107 }.bind(this)); | |
108 }, | |
82 }; | 109 }; |
83 | 110 |
84 /** | 111 /** |
85 * Wait for all targets to be hidden. | 112 * Wait for all targets to be hidden. |
86 * @param {Array<Element>} targets | 113 * @param {Array<Element>} targets |
87 */ | 114 */ |
88 function waitUntilHidden(targets) { | 115 function waitUntilHidden(targets) { |
89 function isHidden(el) { return el.hidden; } | 116 function isHidden(el) { return el.hidden; } |
90 function ensureTransition(el) { ensureTransitionEndEvent(el, 500); } | 117 function ensureTransition(el) { ensureTransitionEndEvent(el, 500); } |
91 | 118 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
371 * @constructor | 398 * @constructor |
372 */ | 399 */ |
373 function OptionsWebUIExtendedTest() {} | 400 function OptionsWebUIExtendedTest() {} |
374 | 401 |
375 OptionsWebUIExtendedTest.prototype = { | 402 OptionsWebUIExtendedTest.prototype = { |
376 __proto__: OptionsWebUITest.prototype, | 403 __proto__: OptionsWebUITest.prototype, |
377 | 404 |
378 /** @override */ | 405 /** @override */ |
379 typedefCppFixture: 'OptionsBrowserTest', | 406 typedefCppFixture: 'OptionsBrowserTest', |
380 | 407 |
408 /** @override */ | |
409 setUp: function() { | |
410 OptionsWebUITest.prototype.setUp.call(this); | |
411 | |
412 // Enable when failure is resolved. | |
413 // AX_ARIA_10: http://crbug.com/559329 | |
414 this.accessibilityAuditConfig.ignoreSelectors( | |
415 'unsupportedAriaAttribute', | |
416 '#profiles-list'); | |
417 | |
418 var controlsWithoutLabelSelectors = [ | |
419 '#cookies-view-page > .content-area.cookies-list-content-area > *', | |
420 '#other-search-engine-list > .deletable-item > DIV > *', | |
421 ]; | |
422 | |
423 // Enable when failure is resolved. | |
424 // AX_TEXT_01: http://crbug.com/559330 | |
425 controlsWithoutLabelSelectors.forEach(function(selector) { | |
426 this.accessibilityAuditConfig.ignoreSelectors( | |
427 'controlsWithoutLabel', | |
428 selector); | |
429 }.bind(this)); | |
430 | |
431 | |
432 var linkWithUnclearPurposeSelectors = [ | |
433 '#sync-overview > A', | |
434 '#privacy-explanation > A', | |
435 '#languages-section > .settings-row > A', | |
436 '#cloudprint-options-mdns > .settings-row > A', | |
437 ]; | |
438 | |
439 // Enable when failure is resolved. | |
440 // AX_TEXT_04: http://crbug.com/559326 | |
441 linkWithUnclearPurposeSelectors.forEach(function(selector) { | |
442 this.accessibilityAuditConfig.ignoreSelectors( | |
443 'linkWithUnclearPurpose', | |
444 selector); | |
445 }.bind(this)); | |
446 }, | |
447 | |
381 testGenPreamble: function() { | 448 testGenPreamble: function() { |
382 // Start with no supervised users managed by this profile. | 449 // Start with no supervised users managed by this profile. |
383 GEN(' ClearPref("' + SUPERVISED_USERS_PREF + '");'); | 450 GEN(' ClearPref("' + SUPERVISED_USERS_PREF + '");'); |
384 }, | 451 }, |
385 | 452 |
386 /** | 453 /** |
387 * Asserts that two non-nested arrays are equal. The arrays must contain only | 454 * Asserts that two non-nested arrays are equal. The arrays must contain only |
388 * plain data types, no nested arrays or other objects. | 455 * plain data types, no nested arrays or other objects. |
389 * @param {Array} expected An array of expected values. | 456 * @param {Array} expected An array of expected values. |
390 * @param {Array} result An array of actual values. | 457 * @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, | 939 __proto__: OptionsWebUIExtendedTest.prototype, |
873 | 940 |
874 /** @override */ | 941 /** @override */ |
875 browsePreload: 'chrome://settings-frame/nonexistantPage', | 942 browsePreload: 'chrome://settings-frame/nonexistantPage', |
876 }; | 943 }; |
877 | 944 |
878 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { | 945 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { |
879 assertEquals('chrome://settings-frame/', document.location.href); | 946 assertEquals('chrome://settings-frame/', document.location.href); |
880 this.verifyHistory_([''], testDone); | 947 this.verifyHistory_([''], testDone); |
881 }); | 948 }); |
OLD | NEW |