Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: google_apis/gcm/engine/mcs_client_unittest.cc

Issue 1183843002: Do not create GCM store if it is not needed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback + fix test Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « google_apis/gcm/engine/gcm_store_impl_unittest.cc ('k') | google_apis/gcm/tools/mcs_probe.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « google_apis/gcm/engine/gcm_store_impl_unittest.cc ('k') | google_apis/gcm/tools/mcs_probe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698