Commit fe27ac42 authored by khmel@chromium.org's avatar khmel@chromium.org Committed by Commit Bot

arc: Limit locale/preferredLanguages for autotest.

In case arc-disable-locale-sync is used this limits ARC container to
start with 'en-US' as a locale and 'en-US,en' as preferred languages.
This stabilizes tests that expects UI resources be fixed in English.
There is an alternative solution that could be implemented when needed
to pass required combination as a switch. However this is not required
at this time once we don't have such auto-tests.

TEST=Set locale for local test account to 'ru' and confirmed that
cheets_AppCompatTest.clamshell.com.google.android.apps.books is failing
similar as described in bug. Apply this patch and test passes.
BUG=b:130142125

Change-Id: I2219207d2d75c00c6ee04590e430a929389c7319
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1559463Reviewed-by: default avatarYusuke Sato <yusukes@chromium.org>
Commit-Queue: Yury Khmel <khmel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649236}
parent 28e20a2a
......@@ -987,7 +987,15 @@ void ArcSessionManager::StartArc() {
std::string locale;
std::string preferred_languages;
GetLocaleAndPreferredLanguages(profile_, &locale, &preferred_languages);
if (IsArcLocaleSyncDisabled()) {
// Use fixed locale and preferred languages for auto-tests.
locale = "en-US";
preferred_languages = "en-US,en";
VLOG(1) << "Locale and preferred languages are fixed to " << locale << ","
<< preferred_languages << ".";
} else {
GetLocaleAndPreferredLanguages(profile_, &locale, &preferred_languages);
}
ArcSession::UpgradeParams params;
......
......@@ -106,7 +106,9 @@ const char kArcDisableAppSync[] = "arc-disable-app-sync";
// Flag that disables ARC locale sync with Android container. Used in autotest
// to prevent conditions when certain apps, including Play Store may get
// restarted. Restarting Play Store may case random test failures.
// restarted. Restarting Play Store may cause random test failures. Enabling
// this flag would also forces ARC container to use 'en-US' as a locale and
// 'en-US,en' as preferred languages.
const char kArcDisableLocaleSync[] = "arc-disable-locale-sync";
// Flag that disables ARC Play Auto Install flow that installs set of predefined
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment