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

Side by Side Diff: chrome/browser/chromeos/mobile_config_unittest.cc

Issue 2605293002: Add WARN_UNUSED_RESULT to base::Time methods that return bool. (Closed)
Patch Set: Add comment to PexeDownloader::didReceiveResponse() Created 3 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 unified diff | Download patch
OLDNEW
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/time.h" 7 #include "base/time/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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 deal = carrier->GetDeal("0"); 140 deal = carrier->GetDeal("0");
141 EXPECT_TRUE(deal != NULL); 141 EXPECT_TRUE(deal != NULL);
142 EXPECT_EQ("en-US", deal->locales()[0]); 142 EXPECT_EQ("en-US", deal->locales()[0]);
143 EXPECT_EQ(1, deal->notification_count()); 143 EXPECT_EQ(1, deal->notification_count());
144 EXPECT_EQ("3G connectivity : Carrier.", 144 EXPECT_EQ("3G connectivity : Carrier.",
145 deal->GetLocalizedString("en-US", "notification_text")); 145 deal->GetLocalizedString("en-US", "notification_text"));
146 EXPECT_EQ("default_text.", 146 EXPECT_EQ("default_text.",
147 deal->GetLocalizedString("en", "notification_text")); 147 deal->GetLocalizedString("en", "notification_text"));
148 148
149 base::Time reference_time; 149 base::Time reference_time;
150 base::Time::FromString("31/12/2099 0:00", &reference_time); 150 EXPECT_TRUE(base::Time::FromString("31/12/2099 0:00", &reference_time));
151 EXPECT_EQ(reference_time, deal->expire_date()); 151 EXPECT_EQ(reference_time, deal->expire_date());
152 152
153 const MobileConfig::LocaleConfig* locale_config; 153 const MobileConfig::LocaleConfig* locale_config;
154 locale_config = config.GetLocaleConfig(); 154 locale_config = config.GetLocaleConfig();
155 EXPECT_TRUE(locale_config != NULL); 155 EXPECT_TRUE(locale_config != NULL);
156 EXPECT_EQ("accounts.carrier.com", locale_config->setup_url()); 156 EXPECT_EQ("accounts.carrier.com", locale_config->setup_url());
157 157
158 // Check same manifest but with another initial locale. 158 // Check same manifest but with another initial locale.
159 MobileConfig config_uk(kGoodMobileConfig, "en-GB"); 159 MobileConfig config_uk(kGoodMobileConfig, "en-GB");
160 EXPECT_TRUE(config_uk.IsReady()); 160 EXPECT_TRUE(config_uk.IsReady());
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 EXPECT_TRUE(deal != NULL); 225 EXPECT_TRUE(deal != NULL);
226 deal = carrier->GetDeal("1"); 226 deal = carrier->GetDeal("1");
227 EXPECT_TRUE(deal != NULL); 227 EXPECT_TRUE(deal != NULL);
228 EXPECT_EQ("en-GB", deal->locales()[0]); 228 EXPECT_EQ("en-GB", deal->locales()[0]);
229 EXPECT_EQ(2, deal->notification_count()); 229 EXPECT_EQ(2, deal->notification_count());
230 EXPECT_EQ("3G connectivity : Carrier.", 230 EXPECT_EQ("3G connectivity : Carrier.",
231 deal->GetLocalizedString("en-GB", "notification_text")); 231 deal->GetLocalizedString("en-GB", "notification_text"));
232 EXPECT_EQ("default_text from local.", 232 EXPECT_EQ("default_text from local.",
233 deal->GetLocalizedString("en", "notification_text")); 233 deal->GetLocalizedString("en", "notification_text"));
234 base::Time reference_time; 234 base::Time reference_time;
235 base::Time::FromString("31/12/2099 0:00", &reference_time); 235 EXPECT_TRUE(base::Time::FromString("31/12/2099 0:00", &reference_time));
236 EXPECT_EQ(reference_time, deal->expire_date()); 236 EXPECT_EQ(reference_time, deal->expire_date());
237 237
238 // Now reload same global/local config files but with proper initial locale. 238 // Now reload same global/local config files but with proper initial locale.
239 MobileConfig config_us(kGoodMobileConfig, "en-US"); 239 MobileConfig config_us(kGoodMobileConfig, "en-US");
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698