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

Side by Side Diff: chrome/browser/sync/test/integration/sync_test.cc

Issue 9572039: Convert uses of int ms to TimeDelta in chrome/browser/sync. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 9 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/sync/syncable/syncable_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync/test/integration/sync_test.h" 5 #include "chrome/browser/sync/test/integration/sync_test.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 base::CloseProcessHandle(test_server_handle_); 531 base::CloseProcessHandle(test_server_handle_);
532 test_server_handle_ = base::kNullProcessHandle; 532 test_server_handle_ = base::kNullProcessHandle;
533 } 533 }
534 return true; 534 return true;
535 } 535 }
536 536
537 bool SyncTest::WaitForTestServerToStart(int time_ms, int intervals) { 537 bool SyncTest::WaitForTestServerToStart(int time_ms, int intervals) {
538 for (int i = 0; i < intervals; ++i) { 538 for (int i = 0; i < intervals; ++i) {
539 if (IsTestServerRunning()) 539 if (IsTestServerRunning())
540 return true; 540 return true;
541 base::PlatformThread::Sleep(time_ms / intervals); 541 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(
542 time_ms / intervals));
542 } 543 }
543 return false; 544 return false;
544 } 545 }
545 546
546 bool SyncTest::IsTestServerRunning() { 547 bool SyncTest::IsTestServerRunning() {
547 CommandLine* cl = CommandLine::ForCurrentProcess(); 548 CommandLine* cl = CommandLine::ForCurrentProcess();
548 std::string sync_url = cl->GetSwitchValueASCII(switches::kSyncServiceURL); 549 std::string sync_url = cl->GetSwitchValueASCII(switches::kSyncServiceURL);
549 GURL sync_url_status(sync_url.append("/healthz")); 550 GURL sync_url_status(sync_url.append("/healthz"));
550 SyncServerStatusChecker delegate; 551 SyncServerStatusChecker delegate;
551 scoped_ptr<content::URLFetcher> fetcher(content::URLFetcher::Create( 552 scoped_ptr<content::URLFetcher> fetcher(content::URLFetcher::Create(
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 759
759 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, 760 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter,
760 const net::ProxyConfig& proxy_config) { 761 const net::ProxyConfig& proxy_config) {
761 base::WaitableEvent done(false, false); 762 base::WaitableEvent done(false, false);
762 BrowserThread::PostTask( 763 BrowserThread::PostTask(
763 BrowserThread::IO, FROM_HERE, 764 BrowserThread::IO, FROM_HERE,
764 base::Bind(&SetProxyConfigCallback, &done, 765 base::Bind(&SetProxyConfigCallback, &done,
765 make_scoped_refptr(context_getter), proxy_config)); 766 make_scoped_refptr(context_getter), proxy_config));
766 done.Wait(); 767 done.Wait();
767 } 768 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/syncable/syncable_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698