| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/mobile_config.h" | 5 #include "chrome/browser/chromeos/mobile_config.h" |
| 6 | 6 |
| 7 #include "base/time.h" | 7 #include "base/time.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 EXPECT_TRUE(locale_config == NULL); | 162 EXPECT_TRUE(locale_config == NULL); |
| 163 } | 163 } |
| 164 | 164 |
| 165 TEST(MobileConfigTest, OldDeal) { | 165 TEST(MobileConfigTest, OldDeal) { |
| 166 MobileConfig config(kOldDealMobileConfig, "en-US"); | 166 MobileConfig config(kOldDealMobileConfig, "en-US"); |
| 167 EXPECT_TRUE(config.IsReady()); | 167 EXPECT_TRUE(config.IsReady()); |
| 168 const MobileConfig::Carrier* carrier; | 168 const MobileConfig::Carrier* carrier; |
| 169 carrier = config.GetCarrier("Carrier (country)"); | 169 carrier = config.GetCarrier("Carrier (country)"); |
| 170 EXPECT_TRUE(carrier != NULL); | 170 EXPECT_TRUE(carrier != NULL); |
| 171 // Check default value. | 171 // Check default value. |
| 172 EXPECT_EQ(false, carrier->show_portal_button()); | 172 EXPECT_FALSE(carrier->show_portal_button()); |
| 173 const MobileConfig::CarrierDeal* deal; | 173 const MobileConfig::CarrierDeal* deal; |
| 174 // TODO(nkostylev): Pass fixed time instead of relying on Time::Now(). | 174 // TODO(nkostylev): Pass fixed time instead of relying on Time::Now(). |
| 175 deal = carrier->GetDefaultDeal(); | 175 deal = carrier->GetDefaultDeal(); |
| 176 EXPECT_TRUE(deal == NULL); | 176 EXPECT_TRUE(deal == NULL); |
| 177 } | 177 } |
| 178 | 178 |
| 179 TEST(MobileConfigTest, DealOtherLocale) { | 179 TEST(MobileConfigTest, DealOtherLocale) { |
| 180 MobileConfig config(kGoodMobileConfig, "en-GB"); | 180 MobileConfig config(kGoodMobileConfig, "en-GB"); |
| 181 EXPECT_TRUE(config.IsReady()); | 181 EXPECT_TRUE(config.IsReady()); |
| 182 const MobileConfig::Carrier* carrier; | 182 const MobileConfig::Carrier* carrier; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 EXPECT_TRUE(config_us.IsReady()); | 240 EXPECT_TRUE(config_us.IsReady()); |
| 241 config_us.LoadManifestFromString(kLocalMobileConfig); | 241 config_us.LoadManifestFromString(kLocalMobileConfig); |
| 242 EXPECT_TRUE(config_us.IsReady()); | 242 EXPECT_TRUE(config_us.IsReady()); |
| 243 const MobileConfig::LocaleConfig* locale_config; | 243 const MobileConfig::LocaleConfig* locale_config; |
| 244 locale_config = config_us.GetLocaleConfig(); | 244 locale_config = config_us.GetLocaleConfig(); |
| 245 EXPECT_TRUE(locale_config != NULL); | 245 EXPECT_TRUE(locale_config != NULL); |
| 246 EXPECT_EQ("accounts.carrier.com/localized/", locale_config->setup_url()); | 246 EXPECT_EQ("accounts.carrier.com/localized/", locale_config->setup_url()); |
| 247 } | 247 } |
| 248 | 248 |
| 249 } // namespace chromeos | 249 } // namespace chromeos |
| OLD | NEW |