| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 185 |
| 186 void TestConnectionFactoryImpl::InitHandler() { | 186 void TestConnectionFactoryImpl::InitHandler() { |
| 187 EXPECT_NE(connect_result_, net::ERR_UNEXPECTED); | 187 EXPECT_NE(connect_result_, net::ERR_UNEXPECTED); |
| 188 if (!delay_login_) | 188 if (!delay_login_) |
| 189 ConnectionHandlerCallback(net::OK); | 189 ConnectionHandlerCallback(net::OK); |
| 190 } | 190 } |
| 191 | 191 |
| 192 std::unique_ptr<net::BackoffEntry> | 192 std::unique_ptr<net::BackoffEntry> |
| 193 TestConnectionFactoryImpl::CreateBackoffEntry( | 193 TestConnectionFactoryImpl::CreateBackoffEntry( |
| 194 const net::BackoffEntry::Policy* const policy) { | 194 const net::BackoffEntry::Policy* const policy) { |
| 195 return base::WrapUnique( | 195 return base::MakeUnique<net::BackoffEntry>(&kTestBackoffPolicy, &tick_clock_); |
| 196 new net::BackoffEntry(&kTestBackoffPolicy, &tick_clock_)); | |
| 197 } | 196 } |
| 198 | 197 |
| 199 std::unique_ptr<ConnectionHandler> | 198 std::unique_ptr<ConnectionHandler> |
| 200 TestConnectionFactoryImpl::CreateConnectionHandler( | 199 TestConnectionFactoryImpl::CreateConnectionHandler( |
| 201 base::TimeDelta read_timeout, | 200 base::TimeDelta read_timeout, |
| 202 const ConnectionHandler::ProtoReceivedCallback& read_callback, | 201 const ConnectionHandler::ProtoReceivedCallback& read_callback, |
| 203 const ConnectionHandler::ProtoSentCallback& write_callback, | 202 const ConnectionHandler::ProtoSentCallback& write_callback, |
| 204 const ConnectionHandler::ConnectionChangedCallback& connection_callback) { | 203 const ConnectionHandler::ConnectionChangedCallback& connection_callback) { |
| 205 return std::move(scoped_handler_); | 204 return std::move(scoped_handler_); |
| 206 } | 205 } |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 // Now trigger force a re-connection. | 563 // Now trigger force a re-connection. |
| 565 factory()->SetConnectResult(net::OK); | 564 factory()->SetConnectResult(net::OK); |
| 566 factory()->Connect(); | 565 factory()->Connect(); |
| 567 WaitForConnections(); | 566 WaitForConnections(); |
| 568 | 567 |
| 569 // Re-connection should succeed. | 568 // Re-connection should succeed. |
| 570 EXPECT_TRUE(factory()->IsEndpointReachable()); | 569 EXPECT_TRUE(factory()->IsEndpointReachable()); |
| 571 } | 570 } |
| 572 | 571 |
| 573 } // namespace gcm | 572 } // namespace gcm |
| OLD | NEW |