OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 | 6 |
7 /** | 7 /** |
8 * TestFixture for language options WebUI testing. | 8 * TestFixture for language options WebUI testing. |
9 * @extends {testing.Test} | 9 * @extends {testing.Test} |
10 * @constructor | 10 * @constructor |
11 */ | 11 */ |
12 function LanguageOptionsWebUITest() {} | 12 function LanguageOptionsWebUITest() {} |
13 | 13 |
14 LanguageOptionsWebUITest.prototype = { | 14 LanguageOptionsWebUITest.prototype = { |
15 __proto__: OptionsBrowsertestBase.prototype, | 15 __proto__: OptionsBrowsertestBase.prototype, |
16 | 16 |
17 /** @override */ | 17 /** @override */ |
18 browsePreload: 'chrome://settings-frame/languages', | 18 browsePreload: 'chrome://settings-frame/languages', |
| 19 |
| 20 /** @override */ |
| 21 setUp: function() { |
| 22 OptionsBrowsertestBase.prototype.setUp.call(this); |
| 23 |
| 24 // Enable when failure is resolved. |
| 25 // AX_ARIA_10: http://crbug.com/559266 |
| 26 this.accessibilityAuditConfig.ignoreSelectors( |
| 27 'unsupportedAriaAttribute', |
| 28 '#language-options-list'); |
| 29 |
| 30 // Enable when failure is resolved. |
| 31 // AX_TEXT_04: http://crbug.com/559271 |
| 32 this.accessibilityAuditConfig.ignoreSelectors( |
| 33 'linkWithUnclearPurpose', |
| 34 '#languagePage > .content-area > .language-options-header > A'); |
| 35 } |
19 }; | 36 }; |
20 | 37 |
21 // Test opening language options has correct location. | 38 // Test opening language options has correct location. |
22 TEST_F('LanguageOptionsWebUITest', 'testOpenLanguageOptions', function() { | 39 TEST_F('LanguageOptionsWebUITest', 'testOpenLanguageOptions', function() { |
23 assertEquals(this.browsePreload, document.location.href); | 40 assertEquals(this.browsePreload, document.location.href); |
24 }); | 41 }); |
25 | 42 |
26 GEN('#if defined(OS_WIN) || defined(OS_CHROMEOS)'); | 43 GEN('#if defined(OS_WIN) || defined(OS_CHROMEOS)'); |
27 // Test reselecting the same language as the current UI locale. This should show | 44 // Test reselecting the same language as the current UI locale. This should show |
28 // a "Chrome is displayed in this language" message rather than a restart banner | 45 // a "Chrome is displayed in this language" message rather than a restart banner |
29 // or a [ Display Chrome in this language ] button. | 46 // or a [ Display Chrome in this language ] button. |
30 TEST_F('LanguageOptionsWebUITest', 'reselectUILocale', function() { | 47 TEST_F('LanguageOptionsWebUITest', 'reselectUILocale', function() { |
31 var currentLang = loadTimeData.getString('currentUiLanguageCode'); | 48 var currentLang = loadTimeData.getString('currentUiLanguageCode'); |
32 $('language-options-list').selectLanguageByCode(currentLang); | 49 $('language-options-list').selectLanguageByCode(currentLang); |
33 LanguageOptions.uiLanguageSaved(currentLang); | 50 LanguageOptions.uiLanguageSaved(currentLang); |
34 | 51 |
35 expectTrue($('language-options-ui-language-button').hidden); | 52 expectTrue($('language-options-ui-language-button').hidden); |
36 expectFalse($('language-options-ui-language-message').hidden); | 53 expectFalse($('language-options-ui-language-message').hidden); |
37 expectTrue($('language-options-ui-notification-bar').hidden); | 54 expectTrue($('language-options-ui-notification-bar').hidden); |
38 }); | 55 }); |
39 GEN('#endif'); // defined(OS_WIN) || defined(OS_CHROMEOS) | 56 GEN('#endif'); // defined(OS_WIN) || defined(OS_CHROMEOS) |
OLD | NEW |