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

Side by Side Diff: remoting/protocol/channel_multiplexer_unittest.cc

Issue 1534193004: Use std::move() instead of scoped_ptr<>::Pass(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "remoting/protocol/channel_multiplexer.h" 5 #include "remoting/protocol/channel_multiplexer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 message_loop_.Run(); 97 message_loop_.Run();
98 98
99 EXPECT_TRUE(host_socket->get()); 99 EXPECT_TRUE(host_socket->get());
100 EXPECT_TRUE(client_socket->get()); 100 EXPECT_TRUE(client_socket->get());
101 } 101 }
102 102
103 void OnChannelConnected( 103 void OnChannelConnected(
104 scoped_ptr<P2PStreamSocket>* storage, 104 scoped_ptr<P2PStreamSocket>* storage,
105 int* counter, 105 int* counter,
106 scoped_ptr<P2PStreamSocket> socket) { 106 scoped_ptr<P2PStreamSocket> socket) {
107 *storage = socket.Pass(); 107 *storage = std::move(socket);
108 --(*counter); 108 --(*counter);
109 EXPECT_GE(*counter, 0); 109 EXPECT_GE(*counter, 0);
110 if (*counter == 0) 110 if (*counter == 0)
111 QuitCurrentThread(); 111 QuitCurrentThread();
112 } 112 }
113 113
114 scoped_refptr<net::IOBufferWithSize> CreateTestBuffer(int size) { 114 scoped_refptr<net::IOBufferWithSize> CreateTestBuffer(int size) {
115 scoped_refptr<net::IOBufferWithSize> result = 115 scoped_refptr<net::IOBufferWithSize> result =
116 new net::IOBufferWithSize(size); 116 new net::IOBufferWithSize(size);
117 for (int i = 0; i< size; ++i) { 117 for (int i = 0; i< size; ++i) {
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 .WillOnce(InvokeWithoutArgs( 343 .WillOnce(InvokeWithoutArgs(
344 this, &ChannelMultiplexerTest::DeleteAfterSessionFail)); 344 this, &ChannelMultiplexerTest::DeleteAfterSessionFail));
345 EXPECT_CALL(cb2, OnConnectedPtr(_)) 345 EXPECT_CALL(cb2, OnConnectedPtr(_))
346 .Times(0); 346 .Times(0);
347 347
348 base::RunLoop().RunUntilIdle(); 348 base::RunLoop().RunUntilIdle();
349 } 349 }
350 350
351 } // namespace protocol 351 } // namespace protocol
352 } // namespace remoting 352 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698