Commit fa27f53a authored by Bao-Duy Tran's avatar Bao-Duy Tran Committed by Commit Bot

OobeLocalizationTest: Split test data for Chromium OS vs Chrome OS; Fix

test data for Chrome OS.

These test data are tightly coupled with the actual manifest of the IME
extension in use. There are separate and independent manifests defined
for Chromium OS and Chrome OS.

Chromium OS:
https://cs.chromium.org/chromium/src/chrome/browser/resources/chromeos/input_method/xkb_manifest.json

Chrome OS:
https://cs.chromium.org/chromium/src/chrome/browser/resources/chromeos/input_method/google_xkb_manifest.json

Current test data are based on the Chromium OS manifest and thus some
tests are failing on Chrome OS build in cases where the two manifests
differ. We should completely isolate test data for the two OSes and fix
them for Chrome OS.

Bug: 977170
Change-Id: Ibf47068264e20aa6028b32b60b5d98791c7f49eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808980Reviewed-by: default avatarAchuith Bhandarkar <achuith@chromium.org>
Reviewed-by: default avatarAlexander Alekseev <alemate@chromium.org>
Commit-Queue: Bao-Duy Tran <tranbaoduy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#698829}
parent 3cb0e882
......@@ -133,6 +133,8 @@ class LanguageListWaiter : public WelcomeScreen::Observer {
} // namespace
// These test data depend on the IME extension manifest which differs between
// Chromium OS and Chrome OS.
struct LocalizationTestParams {
const char* initial_locale;
const char* keyboard_layout;
......@@ -140,6 +142,51 @@ struct LocalizationTestParams {
const char* expected_keyboard_layout;
const char* expected_keyboard_select_control;
} const oobe_localization_test_parameters[] = {
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
// ------------------ Non-Latin setup
// For a non-Latin keyboard layout like Russian, we expect to see the US
// keyboard.
{"ru", "xkb:ru::rus", "ru", kUSLayout, "xkb:us::eng"},
{"ru", "xkb:us::eng,xkb:ru::rus", "ru", kUSLayout, "xkb:us::eng"},
// IMEs do not load at OOBE, so we just expect to see the (Latin) Japanese
// keyboard.
{"ja", "xkb:jp::jpn", "ja", "xkb:jp::jpn", "xkb:jp::jpn,[xkb:us::eng]"},
// We don't use the Icelandic locale but the Icelandic keyboard layout
// should still be selected when specified as the default.
{"en-US", "xkb:is::ice", "en-US", "xkb:is::ice",
"xkb:is::ice,[xkb:us::eng,xkb:us:intl:eng,xkb:us:intl_pc:eng,"
"xkb:us:altgr-intl:eng,xkb:us:dvorak:eng,xkb:us:dvp:eng,"
"xkb:us:colemak:eng,xkb:us:workman:eng,xkb:us:workman-intl:eng]"},
// ------------------ Full Latin setup
// French Swiss keyboard.
{"fr", "xkb:ch:fr:fra", "fr", "xkb:ch:fr:fra",
"xkb:ch:fr:fra,[xkb:fr::fra,xkb:fr:bepo:fra,xkb:be::fra,xkb:ca::fra,"
"xkb:ca:multix:fra,xkb:us::eng]"},
// German Swiss keyboard.
{"de", "xkb:ch::ger", "de", "xkb:ch::ger",
"xkb:ch::ger,[xkb:de::ger,xkb:de:neo:ger,xkb:be::ger,xkb:us::eng]"},
// WelcomeScreenMultipleLocales
{"es,en-US,nl", "xkb:be::nld", "es,en-US,nl", "xkb:be::nld",
"xkb:be::nld,[xkb:es::spa,xkb:latam::spa,xkb:us::eng]"},
{"ru,de", "xkb:ru::rus", "ru,de", kUSLayout, "xkb:us::eng"},
// ------------------ Regional Locales
// Synthetic example to test correct merging of different locales.
{"fr-CH,it-CH,de-CH", "xkb:fr::fra,xkb:it::ita,xkb:de::ger",
"fr-CH,it-CH,de-CH", "xkb:fr::fra",
"xkb:fr::fra,xkb:it::ita,xkb:de::ger,"
"[xkb:fr:bepo:fra,xkb:be::fra,xkb:ca::fra,"
"xkb:ch:fr:fra,xkb:ca:multix:fra,xkb:us::eng]"},
// Another synthetic example. Check that british keyboard is available.
{"en-AU", "xkb:us::eng", "en-AU", "xkb:us::eng",
"xkb:us::eng,[xkb:gb:extd:eng,xkb:gb:dvorak:eng]"},
#else
// ------------------ Non-Latin setup
// For a non-Latin keyboard layout like Russian, we expect to see the US
// keyboard.
......@@ -173,20 +220,16 @@ struct LocalizationTestParams {
{"ru,de", "xkb:ru::rus", "ru,de", kUSLayout, "xkb:us::eng"},
// ------------------ Regional Locales
// Syntetic example to test correct merging of different locales.
{"fr-CH,it-CH,de-CH",
"xkb:fr::fra,xkb:it::ita,xkb:de::ger",
"fr-CH,it-CH,de-CH",
"xkb:fr::fra",
// Synthetic example to test correct merging of different locales.
{"fr-CH,it-CH,de-CH", "xkb:fr::fra,xkb:it::ita,xkb:de::ger",
"fr-CH,it-CH,de-CH", "xkb:fr::fra",
"xkb:fr::fra,xkb:it::ita,xkb:de::ger,[xkb:be::fra,xkb:ca::fra,"
"xkb:ch:fr:fra,xkb:ca:multix:fra,xkb:us::eng]"},
"xkb:ch:fr:fra,xkb:ca:multix:fra,xkb:us::eng]"},
// Another syntetic example. Check that british keyboard is available.
{"en-AU",
"xkb:us::eng",
"en-AU",
"xkb:us::eng",
// Another synthetic example. Check that british keyboard is available.
{"en-AU", "xkb:us::eng", "en-AU", "xkb:us::eng",
"xkb:us::eng,[xkb:gb:extd:eng,xkb:gb:dvorak:eng]"},
#endif
};
class OobeLocalizationTest
......
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