| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/test/live_sync/live_sync_test.h" | 5 #include "chrome/test/live_sync/live_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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 } | 453 } |
| 454 return false; | 454 return false; |
| 455 } | 455 } |
| 456 | 456 |
| 457 bool LiveSyncTest::IsTestServerRunning() { | 457 bool LiveSyncTest::IsTestServerRunning() { |
| 458 CommandLine* cl = CommandLine::ForCurrentProcess(); | 458 CommandLine* cl = CommandLine::ForCurrentProcess(); |
| 459 std::string sync_url = cl->GetSwitchValueASCII(switches::kSyncServiceURL); | 459 std::string sync_url = cl->GetSwitchValueASCII(switches::kSyncServiceURL); |
| 460 GURL sync_url_status(sync_url.append("/healthz")); | 460 GURL sync_url_status(sync_url.append("/healthz")); |
| 461 SyncServerStatusChecker delegate; | 461 SyncServerStatusChecker delegate; |
| 462 URLFetcher fetcher(sync_url_status, URLFetcher::GET, &delegate); | 462 URLFetcher fetcher(sync_url_status, URLFetcher::GET, &delegate); |
| 463 fetcher.set_request_context(Profile::GetDefaultRequestContext()); | 463 fetcher.set_request_context(Profile::Deprecated::GetDefaultRequestContext()); |
| 464 fetcher.Start(); | 464 fetcher.Start(); |
| 465 ui_test_utils::RunMessageLoop(); | 465 ui_test_utils::RunMessageLoop(); |
| 466 return delegate.running(); | 466 return delegate.running(); |
| 467 } | 467 } |
| 468 | 468 |
| 469 void LiveSyncTest::EnableNetwork(Profile* profile) { | 469 void LiveSyncTest::EnableNetwork(Profile* profile) { |
| 470 SetProxyConfig(profile->GetRequestContext(), | 470 SetProxyConfig(profile->GetRequestContext(), |
| 471 net::ProxyConfig::CreateDirect()); | 471 net::ProxyConfig::CreateDirect()); |
| 472 // TODO(rsimha): Remove this line once http://crbug.com/53857 is fixed. | 472 // TODO(rsimha): Remove this line once http://crbug.com/53857 is fixed. |
| 473 net::NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests(); | 473 net::NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 const net::ProxyConfig& proxy_config) { | 514 const net::ProxyConfig& proxy_config) { |
| 515 base::WaitableEvent done(false, false); | 515 base::WaitableEvent done(false, false); |
| 516 BrowserThread::PostTask( | 516 BrowserThread::PostTask( |
| 517 BrowserThread::IO, | 517 BrowserThread::IO, |
| 518 FROM_HERE, | 518 FROM_HERE, |
| 519 new SetProxyConfigTask(&done, | 519 new SetProxyConfigTask(&done, |
| 520 context_getter, | 520 context_getter, |
| 521 proxy_config)); | 521 proxy_config)); |
| 522 done.Wait(); | 522 done.Wait(); |
| 523 } | 523 } |
| OLD | NEW |