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

Side by Side Diff: components/gcm_driver/gcm_client_impl_unittest.cc

Issue 1298253002: Remove reference counting from HttpNetworkSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add scary comment Created 5 years, 3 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
OLDNEW
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 "components/gcm_driver/gcm_client_impl.h" 5 #include "components/gcm_driver/gcm_client_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 scoped_ptr<base::Clock> BuildClock() override; 194 scoped_ptr<base::Clock> BuildClock() override;
195 scoped_ptr<MCSClient> BuildMCSClient(const std::string& version, 195 scoped_ptr<MCSClient> BuildMCSClient(const std::string& version,
196 base::Clock* clock, 196 base::Clock* clock,
197 ConnectionFactory* connection_factory, 197 ConnectionFactory* connection_factory,
198 GCMStore* gcm_store, 198 GCMStore* gcm_store,
199 GCMStatsRecorder* recorder) override; 199 GCMStatsRecorder* recorder) override;
200 scoped_ptr<ConnectionFactory> BuildConnectionFactory( 200 scoped_ptr<ConnectionFactory> BuildConnectionFactory(
201 const std::vector<GURL>& endpoints, 201 const std::vector<GURL>& endpoints,
202 const net::BackoffEntry::Policy& backoff_policy, 202 const net::BackoffEntry::Policy& backoff_policy,
203 const scoped_refptr<net::HttpNetworkSession>& gcm_network_session, 203 net::HttpNetworkSession* gcm_network_session,
204 const scoped_refptr<net::HttpNetworkSession>& http_network_session, 204 net::HttpNetworkSession* http_network_session,
205 net::NetLog* net_log, 205 net::NetLog* net_log,
206 GCMStatsRecorder* recorder) override; 206 GCMStatsRecorder* recorder) override;
207 207
208 private: 208 private:
209 base::TimeDelta clock_step_; 209 base::TimeDelta clock_step_;
210 }; 210 };
211 211
212 FakeGCMInternalsBuilder::FakeGCMInternalsBuilder(base::TimeDelta clock_step) 212 FakeGCMInternalsBuilder::FakeGCMInternalsBuilder(base::TimeDelta clock_step)
213 : clock_step_(clock_step) { 213 : clock_step_(clock_step) {
214 } 214 }
(...skipping 12 matching lines...) Expand all
227 GCMStatsRecorder* recorder) { 227 GCMStatsRecorder* recorder) {
228 return make_scoped_ptr<MCSClient>(new FakeMCSClient(clock, 228 return make_scoped_ptr<MCSClient>(new FakeMCSClient(clock,
229 connection_factory, 229 connection_factory,
230 gcm_store, 230 gcm_store,
231 recorder)); 231 recorder));
232 } 232 }
233 233
234 scoped_ptr<ConnectionFactory> FakeGCMInternalsBuilder::BuildConnectionFactory( 234 scoped_ptr<ConnectionFactory> FakeGCMInternalsBuilder::BuildConnectionFactory(
235 const std::vector<GURL>& endpoints, 235 const std::vector<GURL>& endpoints,
236 const net::BackoffEntry::Policy& backoff_policy, 236 const net::BackoffEntry::Policy& backoff_policy,
237 const scoped_refptr<net::HttpNetworkSession>& gcm_network_session, 237 net::HttpNetworkSession* gcm_network_session,
238 const scoped_refptr<net::HttpNetworkSession>& http_network_session, 238 net::HttpNetworkSession* http_network_session,
239 net::NetLog* net_log, 239 net::NetLog* net_log,
240 GCMStatsRecorder* recorder) { 240 GCMStatsRecorder* recorder) {
241 return make_scoped_ptr<ConnectionFactory>(new FakeConnectionFactory()); 241 return make_scoped_ptr<ConnectionFactory>(new FakeConnectionFactory());
242 } 242 }
243 243
244 } // namespace 244 } // namespace
245 245
246 class GCMClientImplTest : public testing::Test, 246 class GCMClientImplTest : public testing::Test,
247 public GCMClient::Delegate { 247 public GCMClient::Delegate {
248 public: 248 public:
(...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 // No need to call CompleteDeleteToken since unregistration request should 1642 // No need to call CompleteDeleteToken since unregistration request should
1643 // not be triggered. 1643 // not be triggered.
1644 PumpLoopUntilIdle(); 1644 PumpLoopUntilIdle();
1645 1645
1646 EXPECT_EQ(UNREGISTRATION_COMPLETED, last_event()); 1646 EXPECT_EQ(UNREGISTRATION_COMPLETED, last_event());
1647 EXPECT_EQ(kAppId, last_app_id()); 1647 EXPECT_EQ(kAppId, last_app_id());
1648 EXPECT_EQ(GCMClient::SUCCESS, last_result()); 1648 EXPECT_EQ(GCMClient::SUCCESS, last_result());
1649 } 1649 }
1650 1650
1651 } // namespace gcm 1651 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698