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

Unified Diff: chrome/test/ppapi/ppapi_test.cc

Issue 10787010: Switch to TimeDelta interfaces in chrome automation test infrastructure. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase onto master. Created 8 years, 5 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 | « chrome/test/ppapi/ppapi_test.h ('k') | chrome/test/pyautolib/pyautolib.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ppapi/ppapi_test.cc
diff --git a/chrome/test/ppapi/ppapi_test.cc b/chrome/test/ppapi/ppapi_test.cc
index 0f4908096c2971473f0f769e4de0e3a47dcf5d01..056b6ada501c230357e171583a410808e51b9f60 100644
--- a/chrome/test/ppapi/ppapi_test.cc
+++ b/chrome/test/ppapi/ppapi_test.cc
@@ -60,14 +60,13 @@ bool IsAudioOutputAvailable() {
PPAPITestBase::TestFinishObserver::TestFinishObserver(
RenderViewHost* render_view_host,
- int timeout_s)
+ base::TimeDelta timeout)
: finished_(false),
waiting_(false),
- timeout_s_(timeout_s) {
+ timeout_(timeout) {
registrar_.Add(this, content::NOTIFICATION_DOM_OPERATION_RESPONSE,
content::Source<RenderViewHost>(render_view_host));
- timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(timeout_s),
- this, &TestFinishObserver::OnTimeout);
+ timer_.Start(FROM_HERE, timeout, this, &TestFinishObserver::OnTimeout);
}
bool PPAPITestBase::TestFinishObserver::WaitForFinish() {
@@ -91,8 +90,7 @@ void PPAPITestBase::TestFinishObserver::Observe(
TrimString(dom_op_details->json, "\"", &response);
if (response == "...") {
timer_.Stop();
- timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(timeout_s_),
- this, &TestFinishObserver::OnTimeout);
+ timer_.Start(FROM_HERE, timeout_, this, &TestFinishObserver::OnTimeout);
} else {
result_ = response;
finished_ = true;
@@ -231,7 +229,8 @@ void PPAPITestBase::RunTestURL(const GURL& test_url) {
// any other value indicates completion (in this case it will start with
// "PASS" or "FAIL"). This keeps us from timing out on waits for long tests.
TestFinishObserver observer(
- chrome::GetActiveWebContents(browser())->GetRenderViewHost(), kTimeoutMs);
+ chrome::GetActiveWebContents(browser())->GetRenderViewHost(),
+ base::TimeDelta::FromMilliseconds(kTimeoutMs));
ui_test_utils::NavigateToURL(browser(), test_url);
« no previous file with comments | « chrome/test/ppapi/ppapi_test.h ('k') | chrome/test/pyautolib/pyautolib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698