| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 182 |
| 183 MCSClientTest::~MCSClientTest() {} | 183 MCSClientTest::~MCSClientTest() {} |
| 184 | 184 |
| 185 void MCSClientTest::SetUp() { | 185 void MCSClientTest::SetUp() { |
| 186 testing::Test::SetUp(); | 186 testing::Test::SetUp(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void MCSClientTest::BuildMCSClient() { | 189 void MCSClientTest::BuildMCSClient() { |
| 190 gcm_store_.reset(new GCMStoreImpl( | 190 gcm_store_.reset(new GCMStoreImpl( |
| 191 temp_directory_.path(), | 191 temp_directory_.path(), |
| 192 message_loop_.message_loop_proxy(), | 192 message_loop_.task_runner(), |
| 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(GCMStore::CREATE_IF_MISSING, base::Bind( | 201 gcm_store_->Load(GCMStore::CREATE_IF_MISSING, base::Bind( |
| 202 &MCSClient::Initialize, | 202 &MCSClient::Initialize, |
| (...skipping 968 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 |