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

Unified Diff: chrome/test/automation/browser_proxy.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/automation/browser_proxy.h ('k') | chrome/test/automation/dom_automation_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/automation/browser_proxy.cc
diff --git a/chrome/test/automation/browser_proxy.cc b/chrome/test/automation/browser_proxy.cc
index 867de74306a9893a52ead4f106b8e8e3a69c0c60..25b3c58bf82ceb2a32fcd526a1b11bbec539cef2 100644
--- a/chrome/test/automation/browser_proxy.cc
+++ b/chrome/test/automation/browser_proxy.cc
@@ -200,10 +200,9 @@ bool BrowserProxy::WaitForTabCountToBecome(int count) {
}
bool BrowserProxy::WaitForTabToBecomeActive(int tab,
- int wait_timeout) {
+ base::TimeDelta wait_timeout) {
const TimeTicks start = TimeTicks::Now();
- const TimeDelta timeout = TimeDelta::FromMilliseconds(wait_timeout);
- while (TimeTicks::Now() - start < timeout) {
+ while (TimeTicks::Now() - start < wait_timeout) {
base::PlatformThread::Sleep(
base::TimeDelta::FromMilliseconds(automation::kSleepTime));
int active_tab;
@@ -438,7 +437,7 @@ bool BrowserProxy::SendJSONRequest(const std::string& request,
return result;
}
-bool BrowserProxy::GetInitialLoadTimes(int timeout_ms,
+bool BrowserProxy::GetInitialLoadTimes(base::TimeDelta timeout,
float* min_start_time,
float* max_stop_time,
std::vector<float>* stop_times) {
@@ -447,7 +446,8 @@ bool BrowserProxy::GetInitialLoadTimes(int timeout_ms,
*max_stop_time = 0;
*min_start_time = -1;
- if (!SendJSONRequest(kJSONCommand, timeout_ms, &json_response)) {
+ if (!SendJSONRequest(
+ kJSONCommand, timeout.InMilliseconds(), &json_response)) {
// Older browser versions do not support GetInitialLoadTimes.
// Fail gracefully and do not record them in this case.
return false;
« no previous file with comments | « chrome/test/automation/browser_proxy.h ('k') | chrome/test/automation/dom_automation_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698