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 } | |
36 }; | 19 }; |
37 | 20 |
38 // Test opening language options has correct location. | 21 // Test opening language options has correct location. |
39 TEST_F('LanguageOptionsWebUITest', 'testOpenLanguageOptions', function() { | 22 TEST_F('LanguageOptionsWebUITest', 'testOpenLanguageOptions', function() { |
40 assertEquals(this.browsePreload, document.location.href); | 23 assertEquals(this.browsePreload, document.location.href); |
41 }); | 24 }); |
42 | 25 |
43 GEN('#if defined(OS_WIN) || defined(OS_CHROMEOS)'); | 26 GEN('#if defined(OS_WIN) || defined(OS_CHROMEOS)'); |
44 // Test reselecting the same language as the current UI locale. This should show | 27 // Test reselecting the same language as the current UI locale. This should show |
45 // a "Chrome is displayed in this language" message rather than a restart banner | 28 // a "Chrome is displayed in this language" message rather than a restart banner |
46 // or a [ Display Chrome in this language ] button. | 29 // or a [ Display Chrome in this language ] button. |
47 TEST_F('LanguageOptionsWebUITest', 'reselectUILocale', function() { | 30 TEST_F('LanguageOptionsWebUITest', 'reselectUILocale', function() { |
48 var currentLang = loadTimeData.getString('currentUiLanguageCode'); | 31 var currentLang = loadTimeData.getString('currentUiLanguageCode'); |
49 $('language-options-list').selectLanguageByCode(currentLang); | 32 $('language-options-list').selectLanguageByCode(currentLang); |
50 LanguageOptions.uiLanguageSaved(currentLang); | 33 LanguageOptions.uiLanguageSaved(currentLang); |
51 | 34 |
52 expectTrue($('language-options-ui-language-button').hidden); | 35 expectTrue($('language-options-ui-language-button').hidden); |
53 expectFalse($('language-options-ui-language-message').hidden); | 36 expectFalse($('language-options-ui-language-message').hidden); |
54 expectTrue($('language-options-ui-notification-bar').hidden); | 37 expectTrue($('language-options-ui-notification-bar').hidden); |
55 }); | 38 }); |
56 GEN('#endif'); // defined(OS_WIN) || defined(OS_CHROMEOS) | 39 GEN('#endif'); // defined(OS_WIN) || defined(OS_CHROMEOS) |
OLD | NEW |