| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 GEN_INCLUDE(['options_browsertest_base.js']); | |
| 6 | |
| 7 /** | |
| 8 * TestFixture for language options WebUI testing. | |
| 9 * @extends {testing.Test} | |
| 10 * @constructor | |
| 11 */ | |
| 12 function LanguageOptionsWebUITest() {} | |
| 13 | |
| 14 LanguageOptionsWebUITest.prototype = { | |
| 15 __proto__: OptionsBrowsertestBase.prototype, | |
| 16 | |
| 17 /** @override */ | |
| 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 }; | |
| 37 | |
| 38 // Test opening language options has correct location. | |
| 39 TEST_F('LanguageOptionsWebUITest', 'testOpenLanguageOptions', function() { | |
| 40 assertEquals(this.browsePreload, document.location.href); | |
| 41 }); | |
| 42 | |
| 43 GEN('#if defined(OS_WIN) || defined(OS_CHROMEOS)'); | |
| 44 // 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 | |
| 46 // or a [ Display Chrome in this language ] button. | |
| 47 TEST_F('LanguageOptionsWebUITest', 'reselectUILocale', function() { | |
| 48 var currentLang = loadTimeData.getString('currentUiLanguageCode'); | |
| 49 $('language-options-list').selectLanguageByCode(currentLang); | |
| 50 LanguageOptions.uiLanguageSaved(currentLang); | |
| 51 | |
| 52 expectTrue($('language-options-ui-language-button').hidden); | |
| 53 expectFalse($('language-options-ui-language-message').hidden); | |
| 54 expectTrue($('language-options-ui-notification-bar').hidden); | |
| 55 }); | |
| 56 GEN('#endif'); // defined(OS_WIN) || defined(OS_CHROMEOS) | |
| OLD | NEW |