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 /** | 5 /** |
6 * TestFixture for language options WebUI testing. | 6 * TestFixture for language options WebUI testing. |
7 * @extends {testing.Test} | 7 * @extends {testing.Test} |
8 * @constructor | 8 * @constructor |
9 */ | 9 */ |
10 function LanguageOptionsWebUITest() {} | 10 function LanguageOptionsWebUITest() {} |
11 | 11 |
12 LanguageOptionsWebUITest.prototype = { | 12 LanguageOptionsWebUITest.prototype = { |
13 __proto__: testing.Test.prototype, | 13 __proto__: testing.Test.prototype, |
14 | 14 |
15 /** @override */ | 15 /** @override */ |
16 browsePreload: 'chrome://settings-frame/languages', | 16 browsePreload: 'chrome://settings-frame/languages', |
| 17 |
| 18 /** @override */ |
| 19 runAccessibilityChecks: true, |
| 20 |
| 21 /** @override */ |
| 22 accessibilityIssuesAreErrors: true, |
| 23 |
| 24 /** override */ |
| 25 setUp: function() { |
| 26 // user-image-stream is a streaming video element used for capturing a |
| 27 // user image. |
| 28 this.accessibilityAuditConfig.ignoreSelectors('videoWithoutCaptions', |
| 29 '.user-image-stream'); |
| 30 }, |
17 }; | 31 }; |
18 | 32 |
19 // Test opening language options has correct location. | 33 // Test opening language options has correct location. |
20 TEST_F('LanguageOptionsWebUITest', 'testOpenLanguageOptions', function() { | 34 TEST_F('LanguageOptionsWebUITest', 'testOpenLanguageOptions', function() { |
21 assertEquals(this.browsePreload, document.location.href); | 35 assertEquals(this.browsePreload, document.location.href); |
22 }); | 36 }); |
23 | 37 |
24 GEN('#if defined(OS_WIN) || defined(OS_CHROMEOS)'); | 38 GEN('#if defined(OS_WIN) || defined(OS_CHROMEOS)'); |
25 // Test reselecting the same language as the current UI locale. This should show | 39 // Test reselecting the same language as the current UI locale. This should show |
26 // a "Chrome is displayed in this language" message rather than a restart banner | 40 // a "Chrome is displayed in this language" message rather than a restart banner |
27 // or a [ Display Chrome in this language ] button. | 41 // or a [ Display Chrome in this language ] button. |
28 TEST_F('LanguageOptionsWebUITest', 'reselectUILocale', function() { | 42 TEST_F('LanguageOptionsWebUITest', 'reselectUILocale', function() { |
29 var currentLang = loadTimeData.getString('currentUiLanguageCode'); | 43 var currentLang = loadTimeData.getString('currentUiLanguageCode'); |
30 $('language-options-list').selectLanguageByCode(currentLang); | 44 $('language-options-list').selectLanguageByCode(currentLang); |
31 LanguageOptions.uiLanguageSaved(currentLang); | 45 LanguageOptions.uiLanguageSaved(currentLang); |
32 | 46 |
33 expectTrue($('language-options-ui-language-button').hidden); | 47 expectTrue($('language-options-ui-language-button').hidden); |
34 expectFalse($('language-options-ui-language-message').hidden); | 48 expectFalse($('language-options-ui-language-message').hidden); |
35 expectTrue($('language-options-ui-notification-bar').hidden); | 49 expectTrue($('language-options-ui-notification-bar').hidden); |
36 }); | 50 }); |
37 GEN('#endif'); // defined(OS_WIN) || defined(OS_CHROMEOS) | 51 GEN('#endif'); // defined(OS_WIN) || defined(OS_CHROMEOS) |
OLD | NEW |