| 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 <stdint.h> |
| 6 |
| 5 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 6 #include "google_apis/gcm/engine/gservices_settings.h" | 8 #include "google_apis/gcm/engine/gservices_settings.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 10 |
| 9 namespace gcm { | 11 namespace gcm { |
| 10 | 12 |
| 11 namespace { | 13 namespace { |
| 12 | 14 |
| 13 const int64 kAlternativeCheckinInterval = 16 * 60 * 60; | 15 const int64_t kAlternativeCheckinInterval = 16 * 60 * 60; |
| 14 const char kAlternativeCheckinURL[] = "http://alternative.url/checkin"; | 16 const char kAlternativeCheckinURL[] = "http://alternative.url/checkin"; |
| 15 const char kAlternativeMCSHostname[] = "alternative.gcm.host"; | 17 const char kAlternativeMCSHostname[] = "alternative.gcm.host"; |
| 16 const int kAlternativeMCSSecurePort = 7777; | 18 const int kAlternativeMCSSecurePort = 7777; |
| 17 const char kAlternativeRegistrationURL[] = | 19 const char kAlternativeRegistrationURL[] = |
| 18 "http://alternative.url/registration"; | 20 "http://alternative.url/registration"; |
| 19 | 21 |
| 20 const int64 kDefaultCheckinInterval = 2 * 24 * 60 * 60; // seconds = 2 days. | 22 const int64_t kDefaultCheckinInterval = 2 * 24 * 60 * 60; // seconds = 2 days. |
| 21 const char kDefaultCheckinURL[] = "https://android.clients.google.com/checkin"; | 23 const char kDefaultCheckinURL[] = "https://android.clients.google.com/checkin"; |
| 22 const char kDefaultRegistrationURL[] = | 24 const char kDefaultRegistrationURL[] = |
| 23 "https://android.clients.google.com/c2dm/register3"; | 25 "https://android.clients.google.com/c2dm/register3"; |
| 24 const char kDefaultSettingsDigest[] = | 26 const char kDefaultSettingsDigest[] = |
| 25 "1-da39a3ee5e6b4b0d3255bfef95601890afd80709"; | 27 "1-da39a3ee5e6b4b0d3255bfef95601890afd80709"; |
| 26 const char kAlternativeSettingsDigest[] = | 28 const char kAlternativeSettingsDigest[] = |
| 27 "1-7da4aa4eb38a8bd3e330e3751cc0899924499134"; | 29 "1-7da4aa4eb38a8bd3e330e3751cc0899924499134"; |
| 28 | 30 |
| 29 void AddSettingsToResponse( | 31 void AddSettingsToResponse( |
| 30 checkin_proto::AndroidCheckinResponse& checkin_response, | 32 checkin_proto::AndroidCheckinResponse& checkin_response, |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 checkin_response.Clear(); | 328 checkin_response.Clear(); |
| 327 AddSettingsToResponse(checkin_response, settings_diff, true); | 329 AddSettingsToResponse(checkin_response, settings_diff, true); |
| 328 EXPECT_TRUE(settings().UpdateFromCheckinResponse(checkin_response)); | 330 EXPECT_TRUE(settings().UpdateFromCheckinResponse(checkin_response)); |
| 329 EXPECT_EQ(full_settings, settings().settings_map()); | 331 EXPECT_EQ(full_settings, settings().settings_map()); |
| 330 // Default setting back to norm. | 332 // Default setting back to norm. |
| 331 EXPECT_EQ(GURL("https://mtalk.google.com:5228"), | 333 EXPECT_EQ(GURL("https://mtalk.google.com:5228"), |
| 332 settings().GetMCSMainEndpoint()); | 334 settings().GetMCSMainEndpoint()); |
| 333 } | 335 } |
| 334 | 336 |
| 335 } // namespace gcm | 337 } // namespace gcm |
| OLD | NEW |