summaryrefslogtreecommitdiffstats
path: root/base/process_util_unittest.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-09 18:53:13 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-09 18:53:13 +0000
commit9749550b77e75523ed3bbedfb52b34536799e280 (patch)
treedba56656d68ef252bc8d43a0ac821e856d9de194 /base/process_util_unittest.cc
parentc1db769fcfe01c337c207f0f178d49ccc6c417d3 (diff)
downloadchromium_src-9749550b77e75523ed3bbedfb52b34536799e280.zip
chromium_src-9749550b77e75523ed3bbedfb52b34536799e280.tar.gz
chromium_src-9749550b77e75523ed3bbedfb52b34536799e280.tar.bz2
GTTF: Initialize TestTimeouts in out-of-process test runner.
This is needed to make command-line changes take effect. Also, added checks to prevent a similar mistake from happening in the future. Actually, the checks detected such misuse in process_util_unittests, and this CL fixes it. BUG=85287 Review URL: http://codereview.chromium.org/7044048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88561 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_unittest.cc')
-rw-r--r--base/process_util_unittest.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc
index 02d02ac..06b7537 100644
--- a/base/process_util_unittest.cc
+++ b/base/process_util_unittest.cc
@@ -59,9 +59,6 @@ const int kExpectedKilledExitCode = 1;
const int kExpectedStillRunningExitCode = 0;
#endif
-// The longest we'll wait for a process, in milliseconds.
-const int kMaxWaitTimeMs = TestTimeouts::action_max_timeout_ms();
-
// Sleeps until file filename is created.
void WaitToDie(const char* filename) {
FILE *fp;
@@ -94,7 +91,7 @@ base::TerminationStatus WaitForChildTermination(base::ProcessHandle handle,
base::PlatformThread::Sleep(kIntervalMs);
waited += kIntervalMs;
} while (status == base::TERMINATION_STATUS_STILL_RUNNING &&
- waited < kMaxWaitTimeMs);
+ waited < TestTimeouts::action_max_timeout_ms());
return status;
}
@@ -116,7 +113,8 @@ MULTIPROCESS_TEST_MAIN(SimpleChildProcess) {
TEST_F(ProcessUtilTest, SpawnChild) {
base::ProcessHandle handle = this->SpawnChild("SimpleChildProcess", false);
ASSERT_NE(base::kNullProcessHandle, handle);
- EXPECT_TRUE(base::WaitForSingleProcess(handle, kMaxWaitTimeMs));
+ EXPECT_TRUE(base::WaitForSingleProcess(
+ handle, TestTimeouts::action_max_timeout_ms()));
base::CloseProcessHandle(handle);
}
@@ -130,7 +128,8 @@ TEST_F(ProcessUtilTest, KillSlowChild) {
base::ProcessHandle handle = this->SpawnChild("SlowChildProcess", false);
ASSERT_NE(base::kNullProcessHandle, handle);
SignalChildren(kSignalFileSlow);
- EXPECT_TRUE(base::WaitForSingleProcess(handle, kMaxWaitTimeMs));
+ EXPECT_TRUE(base::WaitForSingleProcess(
+ handle, TestTimeouts::action_max_timeout_ms()));
base::CloseProcessHandle(handle);
remove(kSignalFileSlow);
}