Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2264)

Unified Diff: chrome/browser/chromeos/policy/device_local_account_browsertest.cc

Issue 483523005: Default to current UI locale when recommended locales are invalid (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix code that was not actually working. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/policy/device_local_account_browsertest.cc
diff --git a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc
index 23c1675331bdd432b756b5ee65893738859f23b4..bd70560e8481cbe8eef9214234d01c0b9ddb6a12 100644
--- a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc
+++ b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc
@@ -191,6 +191,9 @@ const char* kRecommendedLocales2[] = {
"fr",
"nl",
};
+const char* kInvalidRecommendedLocale[] = {
+ "xx",
+};
const char kPublicSessionLocale[] = "de";
const char kPublicSessionInputMethodIDTemplate[] = "_comp_ime_%sxkb:de:neo:ger";
@@ -1748,6 +1751,49 @@ IN_PROC_BROWSER_TEST_F(DeviceLocalAccountTest, MultipleRecommendedLocales) {
.id());
}
+IN_PROC_BROWSER_TEST_F(DeviceLocalAccountTest, InvalidRecommendedLocale) {
+ // Specify an invalid recommended locale.
+ SetRecommendedLocales(kInvalidRecommendedLocale,
+ arraysize(kInvalidRecommendedLocale));
+ UploadAndInstallDeviceLocalAccountPolicy();
+ AddPublicSessionToDevicePolicy(kAccountId1);
+
+ WaitForPolicy();
+
+ // Click on the pod to expand it. Verify that the pod expands to its basic
pneubeck (no reviews) 2014/08/21 07:29:15 Are invalid locales filtered before showing them i
bartfab (slow) 2014/08/21 09:03:33 Locales cannot be filtered in the policy handler b
+ // form as there is only one recommended locale.
+ bool advanced = false;
+ ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
+ contents_,
+ base::StringPrintf(
+ "var pod ="
+ " document.getElementById('pod-row').getPodWithUsername_('%s');"
+ "pod.click();"
+ "domAutomationController.send(pod.classList.contains('advanced'));",
+ user_id_1_.c_str()),
+ &advanced));
+ EXPECT_FALSE(advanced);
+ EXPECT_EQ(l10n_util::GetLanguage(initial_locale_),
+ icu::Locale::getDefault().getLanguage());
+
+ // Click the enter button to start the session.
+ ASSERT_TRUE(content::ExecuteScript(
+ contents_,
+ base::StringPrintf(
+ "document.getElementById('pod-row').getPodWithUsername_('%s')"
+ " .querySelector('.enter-button').click();",
+ user_id_1_.c_str())));
+
+ WaitForSessionStart();
+
+ // Verify that since the recommended locale was invalid, the locale has not
+ // changed and the first keyboard layout applicable to the locale was chosen.
+ EXPECT_EQ(initial_locale_, g_browser_process->GetApplicationLocale());
+ EXPECT_EQ(l10n_util::GetLanguage(initial_locale_),
+ icu::Locale::getDefault().getLanguage());
+ VerifyKeyboardLayoutMatchesLocale();
+}
+
IN_PROC_BROWSER_TEST_F(DeviceLocalAccountTest,
AutoLoginWithoutRecommendedLocales) {
UploadAndInstallDeviceLocalAccountPolicy();
« no previous file with comments | « chrome/browser/chromeos/login/screens/user_selection_screen.cc ('k') | chrome/browser/ui/webui/chromeos/login/l10n_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698