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

Unified Diff: chrome/browser/chromeos/customization_document_unittest.cc

Issue 144363006: Expand VPD initial_locale to a list of locales. Use the expanded VPD initial_locale on the OOBE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: After-review. Created 6 years, 11 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/customization_document_unittest.cc
diff --git a/chrome/browser/chromeos/customization_document_unittest.cc b/chrome/browser/chromeos/customization_document_unittest.cc
index 3e22f282df2fa41a79104dcde08991efc1ccbede..e7c75c7b5bcf10da8a819e5174ceb7f0c1e5ebdd 100644
--- a/chrome/browser/chromeos/customization_document_unittest.cc
+++ b/chrome/browser/chromeos/customization_document_unittest.cc
@@ -47,6 +47,21 @@ const char kGoodStartupManifest[] =
" ],"
"}";
+const char kMultiLanguageStartupManifest[] =
+ "{\n"
+ " \"version\": \"1.0\",\n"
+ " \"initial_locale\" : \"en-US,de,fr,it\",\n"
+ " \"initial_timezone\" : \"Europe/Zurich\",\n"
+ " \"keyboard_layout\" : \"xkb:us::eng\",\n"
+ " \"registration_url\" : \"http://www.google.com\",\n"
+ " \"setup_content\" : {\n"
+ " \"default\" : {\n"
+ " \"help_page\" : \"file:///opt/oem/help/en-US/help.html\",\n"
+ " \"eula_page\" : \"file:///opt/oem/eula/en-US/eula.html\",\n"
+ " },\n"
+ " },"
+ "}";
+
const char kBadManifest[] = "{\"version\": \"1\"}";
const char kGoodServicesManifest[] =
@@ -157,6 +172,27 @@ TEST(ServicesCustomizationDocumentTest, Basic) {
EXPECT_EQ("http://mario/global", customization.GetSupportPage("ja"));
}
+#define EXPECT_LOCALE_ENTRY(i, value) \
+ if (customization.configured_locales().size() > i) \
+ EXPECT_EQ(value, customization.configured_locales()[i]) \
+ << "Bad locale value at index " << i
+
+TEST(ServicesCustomizationDocumentTest, MultiLanguage) {
+ system::MockStatisticsProvider mock_statistics_provider;
+ StartupCustomizationDocument customization(&mock_statistics_provider,
+ kMultiLanguageStartupManifest);
+ EXPECT_TRUE(customization.IsReady());
+
+ EXPECT_EQ("en-US,de,fr,it", customization.initial_locale());
+ EXPECT_EQ("en-US", customization.initial_locale_default());
+ EXPECT_EQ(4u, customization.configured_locales().size());
+
+ EXPECT_LOCALE_ENTRY(0, "en-US");
+ EXPECT_LOCALE_ENTRY(1, "de");
+ EXPECT_LOCALE_ENTRY(2, "fr");
+ EXPECT_LOCALE_ENTRY(3, "it");
+}
+
TEST(ServicesCustomizationDocumentTest, BadManifest) {
ServicesCustomizationDocument customization(kBadManifest);
EXPECT_FALSE(customization.IsReady());
« no previous file with comments | « chrome/browser/chromeos/customization_document.cc ('k') | chrome/browser/chromeos/login/login_display_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698