| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 scoped_ptr<CheckinRequest> request_; | 94 scoped_ptr<CheckinRequest> request_; |
| 95 FakeGCMStatsRecorder recorder_; | 95 FakeGCMStatsRecorder recorder_; |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 CheckinRequestTest::CheckinRequestTest() | 98 CheckinRequestTest::CheckinRequestTest() |
| 99 : callback_called_(false), | 99 : callback_called_(false), |
| 100 android_id_(kBlankAndroidId), | 100 android_id_(kBlankAndroidId), |
| 101 security_token_(kBlankSecurityToken), | 101 security_token_(kBlankSecurityToken), |
| 102 checkin_device_type_(0), | 102 checkin_device_type_(0), |
| 103 url_request_context_getter_(new net::TestURLRequestContextGetter( | 103 url_request_context_getter_(new net::TestURLRequestContextGetter( |
| 104 message_loop_.message_loop_proxy())) { | 104 message_loop_.task_runner())) { |
| 105 } | 105 } |
| 106 | 106 |
| 107 CheckinRequestTest::~CheckinRequestTest() {} | 107 CheckinRequestTest::~CheckinRequestTest() {} |
| 108 | 108 |
| 109 void CheckinRequestTest::FetcherCallback( | 109 void CheckinRequestTest::FetcherCallback( |
| 110 const checkin_proto::AndroidCheckinResponse& checkin_response) { | 110 const checkin_proto::AndroidCheckinResponse& checkin_response) { |
| 111 callback_called_ = true; | 111 callback_called_ = true; |
| 112 if (checkin_response.has_android_id()) | 112 if (checkin_response.has_android_id()) |
| 113 android_id_ = checkin_response.android_id(); | 113 android_id_ = checkin_response.android_id(); |
| 114 if (checkin_response.has_security_token()) | 114 if (checkin_response.has_security_token()) |
| (...skipping 264 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 |