OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/connection_factory_impl.h" | 5 #include "google_apis/gcm/engine/connection_factory_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 FakeConnectionHandler* fake_handler_; | 152 FakeConnectionHandler* fake_handler_; |
153 FakeGCMStatsRecorder dummy_recorder_; | 153 FakeGCMStatsRecorder dummy_recorder_; |
154 }; | 154 }; |
155 | 155 |
156 TestConnectionFactoryImpl::TestConnectionFactoryImpl( | 156 TestConnectionFactoryImpl::TestConnectionFactoryImpl( |
157 const base::Closure& finished_callback) | 157 const base::Closure& finished_callback) |
158 : ConnectionFactoryImpl(BuildEndpoints(), | 158 : ConnectionFactoryImpl(BuildEndpoints(), |
159 net::BackoffEntry::Policy(), | 159 net::BackoffEntry::Policy(), |
160 NULL, | 160 NULL, |
161 NULL, | 161 NULL, |
| 162 NULL, |
162 &dummy_recorder_), | 163 &dummy_recorder_), |
163 connect_result_(net::ERR_UNEXPECTED), | 164 connect_result_(net::ERR_UNEXPECTED), |
164 num_expected_attempts_(0), | 165 num_expected_attempts_(0), |
165 connections_fulfilled_(true), | 166 connections_fulfilled_(true), |
166 delay_login_(false), | 167 delay_login_(false), |
167 finished_callback_(finished_callback), | 168 finished_callback_(finished_callback), |
168 fake_handler_(NULL) { | 169 fake_handler_(NULL) { |
169 // Set a non-null time. | 170 // Set a non-null time. |
170 tick_clock_.Advance(base::TimeDelta::FromMilliseconds(1)); | 171 tick_clock_.Advance(base::TimeDelta::FromMilliseconds(1)); |
171 } | 172 } |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 // When the network returns, attempt to connect. | 544 // When the network returns, attempt to connect. |
544 factory()->SetConnectResult(net::OK); | 545 factory()->SetConnectResult(net::OK); |
545 factory()->OnNetworkChanged(net::NetworkChangeNotifier::CONNECTION_4G); | 546 factory()->OnNetworkChanged(net::NetworkChangeNotifier::CONNECTION_4G); |
546 WaitForConnections(); | 547 WaitForConnections(); |
547 | 548 |
548 EXPECT_TRUE(factory()->IsEndpointReachable()); | 549 EXPECT_TRUE(factory()->IsEndpointReachable()); |
549 EXPECT_TRUE(factory()->NextRetryAttempt().is_null()); | 550 EXPECT_TRUE(factory()->NextRetryAttempt().is_null()); |
550 } | 551 } |
551 | 552 |
552 } // namespace gcm | 553 } // namespace gcm |
OLD | NEW |