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

Side by Side Diff: base/process/process_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 unified diff | Download patch
« no previous file with comments | « base/process/process.h ('k') | base/process/process_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/process/process.h" 5 #include "base/process/process.h"
6 6
7 #include "base/process/kill.h" 7 #include "base/process/kill.h"
8 #include "base/test/multiprocess_test.h" 8 #include "base/test/multiprocess_test.h"
9 #include "base/test/test_timeouts.h" 9 #include "base/test/test_timeouts.h"
10 #include "base/threading/platform_thread.h" 10 #include "base/threading/platform_thread.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 const int kDummyExitCode = 42; 118 const int kDummyExitCode = 42;
119 int exit_code = kDummyExitCode; 119 int exit_code = kDummyExitCode;
120 EXPECT_EQ(TERMINATION_STATUS_STILL_RUNNING, 120 EXPECT_EQ(TERMINATION_STATUS_STILL_RUNNING,
121 GetTerminationStatus(process.Handle(), &exit_code)); 121 GetTerminationStatus(process.Handle(), &exit_code));
122 EXPECT_EQ(kExpectedStillRunningExitCode, exit_code); 122 EXPECT_EQ(kExpectedStillRunningExitCode, exit_code);
123 123
124 exit_code = kDummyExitCode; 124 exit_code = kDummyExitCode;
125 int kExpectedExitCode = 250; 125 int kExpectedExitCode = 250;
126 process.Terminate(kExpectedExitCode); 126 process.Terminate(kExpectedExitCode);
127 WaitForSingleProcess(process.Handle(), TestTimeouts::action_max_timeout()); 127 process.WaitForExitWithTimeout(TestTimeouts::action_max_timeout(),
128 &exit_code);
128 129
129 EXPECT_NE(TERMINATION_STATUS_STILL_RUNNING, 130 EXPECT_NE(TERMINATION_STATUS_STILL_RUNNING,
130 GetTerminationStatus(process.Handle(), &exit_code)); 131 GetTerminationStatus(process.Handle(), &exit_code));
131 #if !defined(OS_POSIX) 132 #if !defined(OS_POSIX)
132 // The POSIX implementation actually ignores the exit_code. 133 // The POSIX implementation actually ignores the exit_code.
133 EXPECT_EQ(kExpectedExitCode, exit_code); 134 EXPECT_EQ(kExpectedExitCode, exit_code);
134 #endif 135 #endif
135 } 136 }
136 137
137 MULTIPROCESS_TEST_MAIN(FastSleepyChildProcess) { 138 MULTIPROCESS_TEST_MAIN(FastSleepyChildProcess) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 EXPECT_FALSE(process.IsProcessBackgrounded()); 195 EXPECT_FALSE(process.IsProcessBackgrounded());
195 #else 196 #else
196 process.SetProcessBackgrounded(true); 197 process.SetProcessBackgrounded(true);
197 process.SetProcessBackgrounded(false); 198 process.SetProcessBackgrounded(false);
198 #endif 199 #endif
199 int new_priority = process.GetPriority(); 200 int new_priority = process.GetPriority();
200 EXPECT_EQ(old_priority, new_priority); 201 EXPECT_EQ(old_priority, new_priority);
201 } 202 }
202 203
203 } // namespace base 204 } // namespace base
OLDNEW
« no previous file with comments | « base/process/process.h ('k') | base/process/process_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698