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

Unified Diff: base/process/process_util_unittest.cc

Issue 938453002: Remove base::WaitForSingleProcess (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cl format :( 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process/process_unittest.cc ('k') | chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_util_unittest.cc
diff --git a/base/process/process_util_unittest.cc b/base/process/process_util_unittest.cc
index 5ed15d2ae6b70bce2a0b9e6fcb90c27eff49f21c..11d8874a52ab9576cd9ec5b1f2d08c9808655ac5 100644
--- a/base/process/process_util_unittest.cc
+++ b/base/process/process_util_unittest.cc
@@ -151,8 +151,9 @@ MULTIPROCESS_TEST_MAIN(SimpleChildProcess) {
TEST_F(ProcessUtilTest, SpawnChild) {
base::Process process = SpawnChild("SimpleChildProcess");
ASSERT_TRUE(process.IsValid());
- EXPECT_TRUE(base::WaitForSingleProcess(process.Handle(),
- TestTimeouts::action_max_timeout()));
+ int exit_code;
+ EXPECT_TRUE(process.WaitForExitWithTimeout(
+ TestTimeouts::action_max_timeout(), &exit_code));
}
MULTIPROCESS_TEST_MAIN(SlowChildProcess) {
@@ -167,8 +168,9 @@ TEST_F(ProcessUtilTest, KillSlowChild) {
base::Process process = SpawnChild("SlowChildProcess");
ASSERT_TRUE(process.IsValid());
SignalChildren(signal_file.c_str());
- EXPECT_TRUE(base::WaitForSingleProcess(process.Handle(),
- TestTimeouts::action_max_timeout()));
+ int exit_code;
+ EXPECT_TRUE(process.WaitForExitWithTimeout(
+ TestTimeouts::action_max_timeout(), &exit_code));
remove(signal_file.c_str());
}
@@ -550,12 +552,12 @@ int ProcessUtilTest::CountOpenFDsInChild() {
#if defined(THREAD_SANITIZER)
// Compiler-based ThreadSanitizer makes this test slow.
- CHECK(base::WaitForSingleProcess(process.Handle(),
- base::TimeDelta::FromSeconds(3)));
+ base::TimeDelta timeout = base::TimeDelta::FromSeconds(3);
#else
- CHECK(base::WaitForSingleProcess(process.Handle(),
- base::TimeDelta::FromSeconds(1)));
+ base::TimeDelta timeout = base::TimeDelta::FromSeconds(1);
#endif
+ int exit_code;
+ CHECK(process.WaitForExitWithTimeout(timeout, &exit_code));
ret = IGNORE_EINTR(close(fds[0]));
DPCHECK(ret == 0);
@@ -891,8 +893,9 @@ TEST_F(ProcessUtilTest, DelayedTermination) {
base::Process child_process = SpawnChild("process_util_test_never_die");
ASSERT_TRUE(child_process.IsValid());
base::EnsureProcessTerminated(child_process.Duplicate());
- base::WaitForSingleProcess(child_process.Handle(),
- base::TimeDelta::FromSeconds(5));
+ int exit_code;
+ child_process.WaitForExitWithTimeout(base::TimeDelta::FromSeconds(5),
+ &exit_code);
// Check that process was really killed.
EXPECT_TRUE(IsProcessDead(child_process.Handle()));
« no previous file with comments | « base/process/process_unittest.cc ('k') | chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698