OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/strings/string_number_conversions.h" | 5 #include "base/strings/string_number_conversions.h" |
6 #include "google_apis/gcm/engine/gservices_settings.h" | 6 #include "google_apis/gcm/engine/gservices_settings.h" |
7 #include "google_apis/gcm/engine/registration_info.h" | 7 #include "google_apis/gcm/engine/registration_info.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace gcm { | 10 namespace gcm { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } // namespace | 44 } // namespace |
45 | 45 |
46 class GServicesSettingsTest : public testing::Test { | 46 class GServicesSettingsTest : public testing::Test { |
47 public: | 47 public: |
48 GServicesSettingsTest(); | 48 GServicesSettingsTest(); |
49 virtual ~GServicesSettingsTest(); | 49 virtual ~GServicesSettingsTest(); |
50 | 50 |
51 void CheckAllSetToDefault(); | 51 void CheckAllSetToDefault(); |
52 | 52 |
53 GServicesSettings& settings() { | 53 GServicesSettings& settings() { |
54 return gserivces_settings_; | 54 return gservices_settings_; |
55 } | 55 } |
56 | 56 |
57 private: | 57 private: |
58 GServicesSettings gserivces_settings_; | 58 GServicesSettings gservices_settings_; |
59 }; | 59 }; |
60 | 60 |
61 GServicesSettingsTest::GServicesSettingsTest() | 61 GServicesSettingsTest::GServicesSettingsTest() |
62 : gserivces_settings_() { | 62 : gservices_settings_() { |
63 } | 63 } |
64 | 64 |
65 GServicesSettingsTest::~GServicesSettingsTest() {} | 65 GServicesSettingsTest::~GServicesSettingsTest() {} |
66 | 66 |
67 void GServicesSettingsTest::CheckAllSetToDefault() { | 67 void GServicesSettingsTest::CheckAllSetToDefault() { |
68 EXPECT_EQ(base::TimeDelta::FromSeconds(kDefaultCheckinInterval), | 68 EXPECT_EQ(base::TimeDelta::FromSeconds(kDefaultCheckinInterval), |
69 settings().GetCheckinInterval()); | 69 settings().GetCheckinInterval()); |
70 EXPECT_EQ(GURL(kDefaultCheckinURL), settings().GetCheckinURL()); | 70 EXPECT_EQ(GURL(kDefaultCheckinURL), settings().GetCheckinURL()); |
71 EXPECT_EQ(GURL("https://mtalk.google.com:5228"), | 71 EXPECT_EQ(GURL("https://mtalk.google.com:5228"), |
72 settings().GetMCSMainEndpoint()); | 72 settings().GetMCSMainEndpoint()); |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 checkin_response.Clear(); | 327 checkin_response.Clear(); |
328 AddSettingsToResponse(checkin_response, settings_diff, true); | 328 AddSettingsToResponse(checkin_response, settings_diff, true); |
329 EXPECT_TRUE(settings().UpdateFromCheckinResponse(checkin_response)); | 329 EXPECT_TRUE(settings().UpdateFromCheckinResponse(checkin_response)); |
330 EXPECT_EQ(full_settings, settings().settings_map()); | 330 EXPECT_EQ(full_settings, settings().settings_map()); |
331 // Default setting back to norm. | 331 // Default setting back to norm. |
332 EXPECT_EQ(GURL("https://mtalk.google.com:5228"), | 332 EXPECT_EQ(GURL("https://mtalk.google.com:5228"), |
333 settings().GetMCSMainEndpoint()); | 333 settings().GetMCSMainEndpoint()); |
334 } | 334 } |
335 | 335 |
336 } // namespace gcm | 336 } // namespace gcm |
OLD | NEW |