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: remoting/host/ipc_desktop_environment_unittest.cc

Issue 859413003: Remove uses of CloseProcessHandle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase (revert watcher client changes) Created 5 years, 10 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 | « remoting/host/ipc_desktop_environment.cc ('k') | no next file » | 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 remote_input_injector_ = nullptr; 414 remote_input_injector_ = nullptr;
415 } 415 }
416 416
417 void IpcDesktopEnvironmentTest::OnDisconnectCallback() { 417 void IpcDesktopEnvironmentTest::OnDisconnectCallback() {
418 DeleteDesktopEnvironment(); 418 DeleteDesktopEnvironment();
419 } 419 }
420 420
421 void IpcDesktopEnvironmentTest::OnDesktopAttached( 421 void IpcDesktopEnvironmentTest::OnDesktopAttached(
422 IPC::PlatformFileForTransit desktop_pipe) { 422 IPC::PlatformFileForTransit desktop_pipe) {
423 423
424 base::ProcessHandle process_handle = base::GetCurrentProcessHandle();
425 #if defined(OS_WIN)
426 ASSERT_NE(FALSE, ::DuplicateHandle(GetCurrentProcess(), process_handle,
427 GetCurrentProcess(), &process_handle,
428 0, FALSE, DUPLICATE_SAME_ACCESS));
429 #endif
430
424 // Instruct DesktopSessionProxy to connect to the network-to-desktop pipe. 431 // Instruct DesktopSessionProxy to connect to the network-to-desktop pipe.
425 desktop_environment_factory_->OnDesktopSessionAgentAttached( 432 desktop_environment_factory_->OnDesktopSessionAgentAttached(
426 terminal_id_, base::GetCurrentProcessHandle(), desktop_pipe); 433 terminal_id_, process_handle, desktop_pipe);
427 } 434 }
428 435
429 // Runs until the desktop is attached and exits immediately after that. 436 // Runs until the desktop is attached and exits immediately after that.
430 TEST_F(IpcDesktopEnvironmentTest, Basic) { 437 TEST_F(IpcDesktopEnvironmentTest, Basic) {
431 scoped_ptr<protocol::MockClipboardStub> clipboard_stub( 438 scoped_ptr<protocol::MockClipboardStub> clipboard_stub(
432 new protocol::MockClipboardStub()); 439 new protocol::MockClipboardStub());
433 EXPECT_CALL(*clipboard_stub, InjectClipboardEvent(_)) 440 EXPECT_CALL(*clipboard_stub, InjectClipboardEvent(_))
434 .Times(0); 441 .Times(0);
435 442
436 // Start the input injector and screen capturer. 443 // Start the input injector and screen capturer.
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 screen_controls_->SetScreenResolution(ScreenResolution( 662 screen_controls_->SetScreenResolution(ScreenResolution(
656 webrtc::DesktopSize(100, 100), 663 webrtc::DesktopSize(100, 100),
657 webrtc::DesktopVector(96, 96))); 664 webrtc::DesktopVector(96, 96)));
658 665
659 task_runner_ = nullptr; 666 task_runner_ = nullptr;
660 io_task_runner_ = nullptr; 667 io_task_runner_ = nullptr;
661 main_run_loop_.Run(); 668 main_run_loop_.Run();
662 } 669 }
663 670
664 } // namespace remoting 671 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/ipc_desktop_environment.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698