diff options
author | tedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-20 19:41:56 +0000 |
---|---|---|
committer | tedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-20 19:41:56 +0000 |
commit | a0b900be2e35012f904a15ed278f31124c4b955e (patch) | |
tree | 5218149018d4d4db6640d8d6f05ac23edef3bd60 /chrome_frame | |
parent | 1e9db21babb70b7d861ad65a09d96ced486ab513 (diff) | |
download | chromium_src-a0b900be2e35012f904a15ed278f31124c4b955e.zip chromium_src-a0b900be2e35012f904a15ed278f31124c4b955e.tar.gz chromium_src-a0b900be2e35012f904a15ed278f31124c4b955e.tar.bz2 |
Switch to TimeDelta interfaces in chrome automation test infrastructure.
This is a resubmit of a previously reverted commit:
https://chromiumcodereview.appspot.com/10736064/
BUG=108171
Review URL: https://chromiumcodereview.appspot.com/10787010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147700 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/chrome_frame_automation.cc | 8 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_automation.h | 2 | ||||
-rw-r--r-- | chrome_frame/test/automation_client_mock.cc | 4 | ||||
-rw-r--r-- | chrome_frame/test/perf/chrome_frame_perftest.cc | 14 | ||||
-rw-r--r-- | chrome_frame/test_utils.cc | 5 |
5 files changed, 19 insertions, 14 deletions
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc index 9a649c0..12f14cf 100644 --- a/chrome_frame/chrome_frame_automation.cc +++ b/chrome_frame/chrome_frame_automation.cc @@ -134,7 +134,7 @@ class ChromeFrameAutomationProxyImpl::CFMsgDispatcher ChromeFrameAutomationProxyImpl::ChromeFrameAutomationProxyImpl( AutomationProxyCacheEntry* entry, - std::string channel_id, int launch_timeout) + std::string channel_id, base::TimeDelta launch_timeout) : AutomationProxy(launch_timeout, false), proxy_entry_(entry) { TRACE_EVENT_BEGIN_ETW("chromeframe.automationproxy", this, ""); @@ -251,8 +251,10 @@ void AutomationProxyCacheEntry::CreateProxy(ChromeFrameLaunchParams* params, // At same time we must destroy/stop the thread from another thread. std::string channel_id = AutomationProxy::GenerateChannelID(); ChromeFrameAutomationProxyImpl* proxy = - new ChromeFrameAutomationProxyImpl(this, channel_id, - params->launch_timeout()); + new ChromeFrameAutomationProxyImpl( + this, + channel_id, + base::TimeDelta::FromMilliseconds(params->launch_timeout())); // Ensure that the automation proxy actually respects our choice on whether // or not to check the version. diff --git a/chrome_frame/chrome_frame_automation.h b/chrome_frame/chrome_frame_automation.h index 26c9901..0c778b7 100644 --- a/chrome_frame/chrome_frame_automation.h +++ b/chrome_frame/chrome_frame_automation.h @@ -92,7 +92,7 @@ class ChromeFrameAutomationProxyImpl friend class AutomationProxyCacheEntry; ChromeFrameAutomationProxyImpl(AutomationProxyCacheEntry* entry, std::string channel_id, - int launch_timeout); + base::TimeDelta launch_timeout); class CFMsgDispatcher; class TabProxyNotificationMessageFilter; diff --git a/chrome_frame/test/automation_client_mock.cc b/chrome_frame/test/automation_client_mock.cc index bcd63a7..06a5745 100644 --- a/chrome_frame/test/automation_client_mock.cc +++ b/chrome_frame/test/automation_client_mock.cc @@ -313,7 +313,9 @@ class TestChromeFrameAutomationProxyImpl TestChromeFrameAutomationProxyImpl() // 1 is an unneeded timeout. : ChromeFrameAutomationProxyImpl( - NULL, AutomationProxy::GenerateChannelID(), 1) { + NULL, + AutomationProxy::GenerateChannelID(), + base::TimeDelta::FromMilliseconds(1)) { } MOCK_METHOD3( SendAsAsync, diff --git a/chrome_frame/test/perf/chrome_frame_perftest.cc b/chrome_frame/test/perf/chrome_frame_perftest.cc index c1fd280..a81428f 100644 --- a/chrome_frame/test/perf/chrome_frame_perftest.cc +++ b/chrome_frame/test/perf/chrome_frame_perftest.cc @@ -1498,17 +1498,17 @@ bool RunSingleTestOutOfProc(const std::string& test_name) { if (!base::LaunchProcess(cmd_line, base::LaunchOptions(), &process_handle)) return false; - int test_terminate_timeout_ms = 60 * 1000; + base::TimeDelta test_terminate_timeout = base::TimeDelta::FromMinutes(1); int exit_code = 0; if (!base::WaitForExitCodeWithTimeout(process_handle, &exit_code, - test_terminate_timeout_ms)) { - LOG(ERROR) << "Test timeout (" << test_terminate_timeout_ms - << " ms) exceeded for " << test_name; + test_terminate_timeout)) { + LOG(ERROR) << "Test timeout (" << test_terminate_timeout.InMilliseconds() + << " ms) exceeded for " << test_name; - exit_code = -1; // Set a non-zero exit code to signal a failure. + exit_code = -1; // Set a non-zero exit code to signal a failure. - // Ensure that the process terminates. - base::KillProcess(process_handle, -1, true); + // Ensure that the process terminates. + base::KillProcess(process_handle, -1, true); } base::CloseProcessHandle(process_handle); diff --git a/chrome_frame/test_utils.cc b/chrome_frame/test_utils.cc index 2333cc6..ef8a288 100644 --- a/chrome_frame/test_utils.cc +++ b/chrome_frame/test_utils.cc @@ -113,8 +113,9 @@ void ScopedChromeFrameRegistrar::DoRegistration( << registration_command; } else { base::win::ScopedHandle rundll32(process_handle); - if (!base::WaitForExitCodeWithTimeout(process_handle, &exit_code, - kDllRegistrationTimeoutMs)) { + if (!base::WaitForExitCodeWithTimeout( + process_handle, &exit_code, + base::TimeDelta::FromMilliseconds(kDllRegistrationTimeoutMs))) { LOG(ERROR) << "Timeout waiting to register or unregister DLL with " "command: " << registration_command; base::KillProcess(process_handle, 0, false); |