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 <string> | 5 #include <string> |
6 | 6 |
7 #include "google_apis/gcm/engine/checkin_request.h" | 7 #include "google_apis/gcm/engine/checkin_request.h" |
8 #include "google_apis/gcm/monitoring/fake_gcm_stats_recorder.h" | 8 #include "google_apis/gcm/monitoring/fake_gcm_stats_recorder.h" |
9 #include "google_apis/gcm/protocol/checkin.pb.h" | 9 #include "google_apis/gcm/protocol/checkin.pb.h" |
10 #include "net/base/backoff_entry.h" | 10 #include "net/base/backoff_entry.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 public: | 60 public: |
61 enum ResponseScenario { | 61 enum ResponseScenario { |
62 VALID_RESPONSE, // Both android_id and security_token set in response. | 62 VALID_RESPONSE, // Both android_id and security_token set in response. |
63 MISSING_ANDROID_ID, // android_id is missing. | 63 MISSING_ANDROID_ID, // android_id is missing. |
64 MISSING_SECURITY_TOKEN, // security_token is missing. | 64 MISSING_SECURITY_TOKEN, // security_token is missing. |
65 ANDROID_ID_IS_ZER0, // android_id is 0. | 65 ANDROID_ID_IS_ZER0, // android_id is 0. |
66 SECURITY_TOKEN_IS_ZERO // security_token is 0. | 66 SECURITY_TOKEN_IS_ZERO // security_token is 0. |
67 }; | 67 }; |
68 | 68 |
69 CheckinRequestTest(); | 69 CheckinRequestTest(); |
70 virtual ~CheckinRequestTest(); | 70 ~CheckinRequestTest() override; |
71 | 71 |
72 void FetcherCallback( | 72 void FetcherCallback( |
73 const checkin_proto::AndroidCheckinResponse& response); | 73 const checkin_proto::AndroidCheckinResponse& response); |
74 | 74 |
75 void CreateRequest(uint64 android_id, uint64 security_token); | 75 void CreateRequest(uint64 android_id, uint64 security_token); |
76 | 76 |
77 void SetResponseStatusAndString( | 77 void SetResponseStatusAndString( |
78 net::HttpStatusCode status_code, | 78 net::HttpStatusCode status_code, |
79 const std::string& response_data); | 79 const std::string& response_data); |
80 | 80 |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 | 379 |
380 SetResponse(VALID_RESPONSE); | 380 SetResponse(VALID_RESPONSE); |
381 CompleteFetch(); | 381 CompleteFetch(); |
382 | 382 |
383 EXPECT_TRUE(callback_called_); | 383 EXPECT_TRUE(callback_called_); |
384 EXPECT_EQ(kAndroidId, android_id_); | 384 EXPECT_EQ(kAndroidId, android_id_); |
385 EXPECT_EQ(kSecurityToken, security_token_); | 385 EXPECT_EQ(kSecurityToken, security_token_); |
386 } | 386 } |
387 | 387 |
388 } // namespace gcm | 388 } // namespace gcm |
OLD | NEW |