| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "google_apis/gcm/engine/mcs_client.h" | 5 #include "google_apis/gcm/engine/mcs_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 temp_directory_.path(), | 191 temp_directory_.path(), |
| 192 message_loop_.message_loop_proxy(), | 192 message_loop_.message_loop_proxy(), |
| 193 make_scoped_ptr<Encryptor>(new FakeEncryptor))); | 193 make_scoped_ptr<Encryptor>(new FakeEncryptor))); |
| 194 mcs_client_.reset(new TestMCSClient(&clock_, | 194 mcs_client_.reset(new TestMCSClient(&clock_, |
| 195 &connection_factory_, | 195 &connection_factory_, |
| 196 gcm_store_.get(), | 196 gcm_store_.get(), |
| 197 &recorder_)); | 197 &recorder_)); |
| 198 } | 198 } |
| 199 | 199 |
| 200 void MCSClientTest::InitializeClient() { | 200 void MCSClientTest::InitializeClient() { |
| 201 gcm_store_->Load(base::Bind( | 201 gcm_store_->Load(GCMStore::CREATE_IF_MISSING, base::Bind( |
| 202 &MCSClient::Initialize, | 202 &MCSClient::Initialize, |
| 203 base::Unretained(mcs_client_.get()), | 203 base::Unretained(mcs_client_.get()), |
| 204 base::Bind(&MCSClientTest::ErrorCallback, | 204 base::Bind(&MCSClientTest::ErrorCallback, |
| 205 base::Unretained(this)), | 205 base::Unretained(this)), |
| 206 base::Bind(&MCSClientTest::MessageReceivedCallback, | 206 base::Bind(&MCSClientTest::MessageReceivedCallback, |
| 207 base::Unretained(this)), | 207 base::Unretained(this)), |
| 208 base::Bind(&MCSClientTest::MessageSentCallback, base::Unretained(this)))); | 208 base::Bind(&MCSClientTest::MessageSentCallback, base::Unretained(this)))); |
| 209 run_loop_->RunUntilIdle(); | 209 run_loop_->RunUntilIdle(); |
| 210 run_loop_.reset(new base::RunLoop()); | 210 run_loop_.reset(new base::RunLoop()); |
| 211 } | 211 } |
| (...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1171 | 1171 |
| 1172 // HB manger uses the shortest persisted interval after restart. | 1172 // HB manger uses the shortest persisted interval after restart. |
| 1173 hb_manager = mcs_client()->GetHeartbeatManagerForTesting(); | 1173 hb_manager = mcs_client()->GetHeartbeatManagerForTesting(); |
| 1174 EXPECT_TRUE(hb_manager->HasClientHeartbeatInterval()); | 1174 EXPECT_TRUE(hb_manager->HasClientHeartbeatInterval()); |
| 1175 EXPECT_EQ(interval_ms, hb_manager->GetClientHeartbeatIntervalMs()); | 1175 EXPECT_EQ(interval_ms, hb_manager->GetClientHeartbeatIntervalMs()); |
| 1176 } | 1176 } |
| 1177 | 1177 |
| 1178 } // namespace | 1178 } // namespace |
| 1179 | 1179 |
| 1180 } // namespace gcm | 1180 } // namespace gcm |
| OLD | NEW |