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

Side by Side Diff: remoting/host/win/worker_process_launcher_unittest.cc

Issue 1549493004: Use std::move() instead of .Pass() in remoting/host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_not_pass
Patch Set: Created 4 years, 12 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 (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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/win/scoped_handle.h" 9 #include "base/win/scoped_handle.h"
10 #include "base/win/scoped_process_information.h" 10 #include "base/win/scoped_process_information.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 channel_client_->Send( 307 channel_client_->Send(
308 new ChromotingDesktopNetworkMsg_DisconnectSession(protocol::OK)); 308 new ChromotingDesktopNetworkMsg_DisconnectSession(protocol::OK));
309 } 309 }
310 } 310 }
311 311
312 void WorkerProcessLauncherTest::CrashWorker() { 312 void WorkerProcessLauncherTest::CrashWorker() {
313 launcher_->Crash(FROM_HERE); 313 launcher_->Crash(FROM_HERE);
314 } 314 }
315 315
316 void WorkerProcessLauncherTest::StartWorker() { 316 void WorkerProcessLauncherTest::StartWorker() {
317 launcher_.reset(new WorkerProcessLauncher( 317 launcher_.reset(new WorkerProcessLauncher(std::move(launcher_delegate_),
318 launcher_delegate_.Pass(), 318 &server_listener_));
319 &server_listener_));
320 319
321 launcher_->SetKillProcessTimeoutForTest(base::TimeDelta::FromMilliseconds(0)); 320 launcher_->SetKillProcessTimeoutForTest(base::TimeDelta::FromMilliseconds(0));
322 } 321 }
323 322
324 void WorkerProcessLauncherTest::StopWorker() { 323 void WorkerProcessLauncherTest::StopWorker() {
325 launcher_.reset(); 324 launcher_.reset();
326 DisconnectClient(); 325 DisconnectClient();
327 channel_name_.clear(); 326 channel_name_.clear();
328 channel_server_.reset(); 327 channel_server_.reset();
329 task_runner_ = nullptr; 328 task_runner_ = nullptr;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 HANDLE temp_handle; 370 HANDLE temp_handle;
372 ASSERT_TRUE(DuplicateHandle(GetCurrentProcess(), 371 ASSERT_TRUE(DuplicateHandle(GetCurrentProcess(),
373 worker_process_.Get(), 372 worker_process_.Get(),
374 GetCurrentProcess(), 373 GetCurrentProcess(),
375 &temp_handle, 374 &temp_handle,
376 0, 375 0,
377 FALSE, 376 FALSE,
378 DUPLICATE_SAME_ACCESS)); 377 DUPLICATE_SAME_ACCESS));
379 ScopedHandle copy(temp_handle); 378 ScopedHandle copy(temp_handle);
380 379
381 event_handler_->OnProcessLaunched(copy.Pass()); 380 event_handler_->OnProcessLaunched(std::move(copy));
382 } 381 }
383 382
384 TEST_F(WorkerProcessLauncherTest, Start) { 383 TEST_F(WorkerProcessLauncherTest, Start) {
385 EXPECT_CALL(*launcher_delegate_, LaunchProcess(_)) 384 EXPECT_CALL(*launcher_delegate_, LaunchProcess(_))
386 .Times(1) 385 .Times(1)
387 .WillRepeatedly(Invoke(this, &WorkerProcessLauncherTest::LaunchProcess)); 386 .WillRepeatedly(Invoke(this, &WorkerProcessLauncherTest::LaunchProcess));
388 387
389 EXPECT_CALL(server_listener_, OnChannelConnected(_)) 388 EXPECT_CALL(server_listener_, OnChannelConnected(_))
390 .Times(0); 389 .Times(0);
391 EXPECT_CALL(server_listener_, OnPermanentError(_)) 390 EXPECT_CALL(server_listener_, OnPermanentError(_))
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 EXPECT_CALL(client_listener_, OnCrash(_, _, _)) 525 EXPECT_CALL(client_listener_, OnCrash(_, _, _))
527 .Times(1) 526 .Times(1)
528 .WillOnce(InvokeWithoutArgs( 527 .WillOnce(InvokeWithoutArgs(
529 this, &WorkerProcessLauncherTest::SendFakeMessageToLauncher)); 528 this, &WorkerProcessLauncherTest::SendFakeMessageToLauncher));
530 529
531 StartWorker(); 530 StartWorker();
532 message_loop_.Run(); 531 message_loop_.Run();
533 } 532 }
534 533
535 } // namespace remoting 534 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698