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()); |