diff options
author | tedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-31 22:53:51 +0000 |
---|---|---|
committer | tedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-31 22:53:51 +0000 |
commit | a1b75b94f61d90054e3b432e8be3c897383450bd (patch) | |
tree | 22a388ee703fe9aa05aab3cb850e0012c3b501f8 /base/process_util_unittest.cc | |
parent | d117d35a46d16907c89b92e5ed03d40690fb8f81 (diff) | |
download | chromium_src-a1b75b94f61d90054e3b432e8be3c897383450bd.zip chromium_src-a1b75b94f61d90054e3b432e8be3c897383450bd.tar.gz chromium_src-a1b75b94f61d90054e3b432e8be3c897383450bd.tar.bz2 |
Change code in base (primarily unit tests) to use Sleep(TimeDelta).
BUG=108171
TEST=
Review URL: http://codereview.chromium.org/9055001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116065 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_unittest.cc')
-rw-r--r-- | base/process_util_unittest.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc index 36d48b6..426a78f 100644 --- a/base/process_util_unittest.cc +++ b/base/process_util_unittest.cc @@ -74,7 +74,7 @@ const int kExpectedStillRunningExitCode = 0; void WaitToDie(const char* filename) { FILE *fp; do { - base::PlatformThread::Sleep(10); + base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(10)); fp = fopen(filename, "r"); } while (!fp); fclose(fp); @@ -95,14 +95,14 @@ base::TerminationStatus WaitForChildTermination(base::ProcessHandle handle, int* exit_code) { // Now we wait until the result is something other than STILL_RUNNING. base::TerminationStatus status = base::TERMINATION_STATUS_STILL_RUNNING; - const int kIntervalMs = 20; - int waited = 0; + const base::TimeDelta kInterval = base::TimeDelta::FromMilliseconds(20); + base::TimeDelta waited; do { status = base::GetTerminationStatus(handle, exit_code); - base::PlatformThread::Sleep(kIntervalMs); - waited += kIntervalMs; + base::PlatformThread::Sleep(kInterval); + waited += kInterval; } while (status == base::TERMINATION_STATUS_STILL_RUNNING && - waited < TestTimeouts::action_max_timeout_ms()); + waited.InMilliseconds() < TestTimeouts::action_max_timeout_ms()); return status; } |