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

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

Issue 10141006: [cros] Add support for locale specific configuration in mobile config. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
« no previous file with comments | « chrome/browser/chromeos/mobile_config.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/mobile_config_unittest.cc
diff --git a/chrome/browser/chromeos/mobile_config_unittest.cc b/chrome/browser/chromeos/mobile_config_unittest.cc
index 10c76b6c479c05588023390d5458f7a9ff799136..5f81513b8a0a30acc648f8ff9603e14a6e5ed754 100644
--- a/chrome/browser/chromeos/mobile_config_unittest.cc
+++ b/chrome/browser/chromeos/mobile_config_unittest.cc
@@ -46,6 +46,11 @@ const char kGoodMobileConfig[] =
" ],\n"
" },"
" },"
+ " \"initial_locales\" : {\n"
+ " \"en-US\" : {\n"
+ " \"setup_url\" : \"accounts.carrier.com\",\n"
+ " },"
+ " },"
"}";
const char kOldDealMobileConfig[] =
@@ -106,7 +111,12 @@ const char kLocalMobileConfig[] =
" },\n"
" ],\n"
" },"
- " },"
+ " },"
+ " \"initial_locales\" : {\n"
+ " \"en-US\" : {\n"
+ " \"setup_url\" : \"accounts.carrier.com/localized/\",\n"
+ " },"
+ " },"
"}";
} // anonymous namespace
@@ -139,6 +149,17 @@ TEST(MobileConfigTest, Basic) {
base::Time reference_time;
base::Time::FromString("31/12/12 0:00", &reference_time);
EXPECT_EQ(reference_time, deal->expire_date());
+
+ const MobileConfig::LocaleConfig* locale_config;
+ locale_config = config.GetLocaleConfig();
+ EXPECT_TRUE(locale_config != NULL);
+ EXPECT_EQ("accounts.carrier.com", locale_config->setup_url());
+
+ // Check same manifest but with another initial locale.
+ MobileConfig config_uk(kGoodMobileConfig, "en-GB");
+ EXPECT_TRUE(config_uk.IsReady());
+ locale_config = config_uk.GetLocaleConfig();
+ EXPECT_TRUE(locale_config == NULL);
}
TEST(MobileConfigTest, OldDeal) {
@@ -213,6 +234,16 @@ TEST(MobileConfigTest, LocalConfig) {
base::Time reference_time;
base::Time::FromString("31/12/13 0:00", &reference_time);
EXPECT_EQ(reference_time, deal->expire_date());
+
+ // Now reload same global/local config files but with proper initial locale.
+ MobileConfig config_us(kGoodMobileConfig, "en-US");
+ EXPECT_TRUE(config_us.IsReady());
+ config_us.LoadManifestFromString(kLocalMobileConfig);
+ EXPECT_TRUE(config_us.IsReady());
+ const MobileConfig::LocaleConfig* locale_config;
+ locale_config = config_us.GetLocaleConfig();
+ EXPECT_TRUE(locale_config != NULL);
+ EXPECT_EQ("accounts.carrier.com/localized/", locale_config->setup_url());
}
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/mobile_config.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698