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

Side by Side Diff: components/browser_watcher/window_hang_monitor_win_unittest.cc

Issue 2950153002: Improve process launch handle sharing API. (Closed)
Patch Set: Fix Mojo launcher, review comments Created 3 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/browser_watcher/window_hang_monitor_win.h" 5 #include "components/browser_watcher/window_hang_monitor_win.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/base_switches.h" 10 #include "base/base_switches.h"
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 355
356 base::CommandLine command_line = 356 base::CommandLine command_line =
357 base::GetMultiProcessTestChildBaseCommandLine(); 357 base::GetMultiProcessTestChildBaseCommandLine();
358 command_line.AppendSwitchASCII(switches::kTestChildProcess, 358 command_line.AppendSwitchASCII(switches::kTestChildProcess,
359 "MonitoredProcess"); 359 "MonitoredProcess");
360 360
361 AppendSwitchHandle(&command_line, kChildReadPipeSwitch, child_read_pipe); 361 AppendSwitchHandle(&command_line, kChildReadPipeSwitch, child_read_pipe);
362 AppendSwitchHandle(&command_line, kChildWritePipeSwitch, child_write_pipe); 362 AppendSwitchHandle(&command_line, kChildWritePipeSwitch, child_write_pipe);
363 363
364 base::LaunchOptions options = {}; 364 base::LaunchOptions options = {};
365 options.inherit_handles = true; 365 options.inherit_mode = base::LaunchOptions::Inherit::kAll;
jschuh 2017/07/24 19:41:27 Leave a TODO here.
366 monitored_process_ = base::LaunchProcess(command_line, options); 366 monitored_process_ = base::LaunchProcess(command_line, options);
367 if (!monitored_process_.IsValid()) 367 if (!monitored_process_.IsValid())
368 return false; 368 return false;
369 369
370 return WaitForSignal(IPC_SIGNAL_READY); 370 return WaitForSignal(IPC_SIGNAL_READY);
371 } 371 }
372 372
373 void StartHangMonitor() { 373 void StartHangMonitor() {
374 monitor_thread_.Start(monitored_process_.Duplicate()); 374 monitor_thread_.Start(monitored_process_.Duplicate());
375 } 375 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 469
470 ASSERT_TRUE(SendSignal(IPC_SIGNAL_HANG_MESSAGE_WINDOW)); 470 ASSERT_TRUE(SendSignal(IPC_SIGNAL_HANG_MESSAGE_WINDOW));
471 471
472 EXPECT_EQ(WindowHangMonitor::WINDOW_HUNG, 472 EXPECT_EQ(WindowHangMonitor::WINDOW_HUNG,
473 monitor_thread().WaitForEvent()); 473 monitor_thread().WaitForEvent());
474 474
475 ASSERT_TRUE(SendSignal(IPC_SIGNAL_TERMINATE_PROCESS)); 475 ASSERT_TRUE(SendSignal(IPC_SIGNAL_TERMINATE_PROCESS));
476 } 476 }
477 477
478 } // namespace browser_watcher 478 } // namespace browser_watcher
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698