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

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

Issue 2256183002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/drive/base_requests.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 (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
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
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
OLDNEW
« no previous file with comments | « google_apis/drive/base_requests.cc ('k') | google_apis/gcm/tools/mcs_probe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698