diff options
Diffstat (limited to 'chrome/test/ppapi')
-rw-r--r-- | chrome/test/ppapi/ppapi_browsertest.cc | 2 | ||||
-rw-r--r-- | chrome/test/ppapi/ppapi_test.cc | 13 | ||||
-rw-r--r-- | chrome/test/ppapi/ppapi_test.h | 4 |
3 files changed, 10 insertions, 9 deletions
diff --git a/chrome/test/ppapi/ppapi_browsertest.cc b/chrome/test/ppapi/ppapi_browsertest.cc index 06b922b..5b4e54a 100644 --- a/chrome/test/ppapi/ppapi_browsertest.cc +++ b/chrome/test/ppapi/ppapi_browsertest.cc @@ -725,7 +725,7 @@ IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_PageHideShow) { // The plugin will be loaded in the foreground tab and will send us a message. TestFinishObserver observer( chrome::GetActiveWebContents(browser())->GetRenderViewHost(), - TestTimeouts::action_max_timeout()); + TestTimeouts::action_max_timeout_ms()); GURL url = GetTestFileUrl("View_PageHideShow"); ui_test_utils::NavigateToURL(browser(), url); diff --git a/chrome/test/ppapi/ppapi_test.cc b/chrome/test/ppapi/ppapi_test.cc index 89772bb..bef0daf 100644 --- a/chrome/test/ppapi/ppapi_test.cc +++ b/chrome/test/ppapi/ppapi_test.cc @@ -60,13 +60,14 @@ bool IsAudioOutputAvailable() { PPAPITestBase::TestFinishObserver::TestFinishObserver( RenderViewHost* render_view_host, - base::TimeDelta timeout) + int timeout_s) : finished_(false), waiting_(false), - timeout_(timeout) { + timeout_s_(timeout_s) { registrar_.Add(this, content::NOTIFICATION_DOM_OPERATION_RESPONSE, content::Source<RenderViewHost>(render_view_host)); - timer_.Start(FROM_HERE, timeout, this, &TestFinishObserver::OnTimeout); + timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(timeout_s), + this, &TestFinishObserver::OnTimeout); } bool PPAPITestBase::TestFinishObserver::WaitForFinish() { @@ -90,7 +91,8 @@ void PPAPITestBase::TestFinishObserver::Observe( TrimString(dom_op_details->json, "\"", &response); if (response == "...") { timer_.Stop(); - timer_.Start(FROM_HERE, timeout_, this, &TestFinishObserver::OnTimeout); + timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(timeout_s_), + this, &TestFinishObserver::OnTimeout); } else { result_ = response; finished_ = true; @@ -230,8 +232,7 @@ 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(), - base::TimeDelta::FromMilliseconds(kTimeoutMs)); + chrome::GetActiveWebContents(browser())->GetRenderViewHost(), kTimeoutMs); ui_test_utils::NavigateToURL(browser(), test_url); diff --git a/chrome/test/ppapi/ppapi_test.h b/chrome/test/ppapi/ppapi_test.h index 4c91097..4e53f74 100644 --- a/chrome/test/ppapi/ppapi_test.h +++ b/chrome/test/ppapi/ppapi_test.h @@ -44,7 +44,7 @@ class PPAPITestBase : public InProcessBrowserTest { class TestFinishObserver : public content::NotificationObserver { public: TestFinishObserver(content::RenderViewHost* render_view_host, - base::TimeDelta timeout); + int timeout_s); bool WaitForFinish(); @@ -61,7 +61,7 @@ class PPAPITestBase : public InProcessBrowserTest { bool finished_; bool waiting_; - base::TimeDelta timeout_; + int timeout_s_; std::string result_; content::NotificationRegistrar registrar_; base::RepeatingTimer<TestFinishObserver> timer_; |