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

Unified Diff: chrome/browser/sync/test/integration/sessions_helper.cc

Issue 10689157: Switch to TimeDelta interfaces for TestTimeouts in sync code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix error messaging again. 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
Index: chrome/browser/sync/test/integration/sessions_helper.cc
diff --git a/chrome/browser/sync/test/integration/sessions_helper.cc b/chrome/browser/sync/test/integration/sessions_helper.cc
index e7ca8b016db9d0a4cb3586db4508abc4b56e66f7..e304a123231f90b16e588e4b5cc1c8a2ed192d4c 100644
--- a/chrome/browser/sync/test/integration/sessions_helper.cc
+++ b/chrome/browser/sync/test/integration/sessions_helper.cc
@@ -121,10 +121,8 @@ bool OpenMultipleTabs(int index, const std::vector<GURL>& urls) {
bool WaitForTabsToLoad(int index, const std::vector<GURL>& urls) {
DVLOG(1) << "Waiting for session to propagate to associator.";
- static const int timeout_milli = TestTimeouts::action_max_timeout_ms();
base::TimeTicks start_time = base::TimeTicks::Now();
- base::TimeTicks end_time = start_time +
- base::TimeDelta::FromMilliseconds(timeout_milli);
+ base::TimeTicks end_time = start_time + TestTimeouts::action_max_timeout();
bool found;
for (std::vector<GURL>::const_iterator it = urls.begin();
it != urls.end(); ++it) {
@@ -132,14 +130,15 @@ bool WaitForTabsToLoad(int index, const std::vector<GURL>& urls) {
while (!found) {
found = ModelAssociatorHasTabWithUrl(index, *it);
if (base::TimeTicks::Now() >= end_time) {
- LOG(ERROR) << "Failed to find all tabs after " << timeout_milli/1000.0
+ LOG(ERROR) << "Failed to find all tabs after "
+ << TestTimeouts::action_max_timeout().InSecondsF()
<< " seconds.";
return false;
}
if (!found) {
ProfileSyncServiceFactory::GetInstance()->GetForProfile(
test()->GetProfile(index))->GetSessionModelAssociator()->
- BlockUntilLocalChangeForTest(timeout_milli);
+ BlockUntilLocalChangeForTest(TestTimeouts::action_max_timeout());
ui_test_utils::RunMessageLoop();
}
}
« no previous file with comments | « chrome/browser/sync/profile_sync_service_password_unittest.cc ('k') | chrome/browser/sync/test/integration/sync_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698