OLD | NEW |
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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 std::string sync_url = cl->GetSwitchValueASCII(switches::kSyncServiceURL); | 561 std::string sync_url = cl->GetSwitchValueASCII(switches::kSyncServiceURL); |
562 GURL sync_url_status(sync_url.append("/healthz")); | 562 GURL sync_url_status(sync_url.append("/healthz")); |
563 SyncServerStatusChecker delegate; | 563 SyncServerStatusChecker delegate; |
564 scoped_ptr<net::URLFetcher> fetcher(net::URLFetcher::Create( | 564 scoped_ptr<net::URLFetcher> fetcher(net::URLFetcher::Create( |
565 sync_url_status, net::URLFetcher::GET, &delegate)); | 565 sync_url_status, net::URLFetcher::GET, &delegate)); |
566 fetcher->SetLoadFlags(net::LOAD_DISABLE_CACHE | | 566 fetcher->SetLoadFlags(net::LOAD_DISABLE_CACHE | |
567 net::LOAD_DO_NOT_SEND_COOKIES | | 567 net::LOAD_DO_NOT_SEND_COOKIES | |
568 net::LOAD_DO_NOT_SAVE_COOKIES); | 568 net::LOAD_DO_NOT_SAVE_COOKIES); |
569 fetcher->SetRequestContext(g_browser_process->system_request_context()); | 569 fetcher->SetRequestContext(g_browser_process->system_request_context()); |
570 fetcher->Start(); | 570 fetcher->Start(); |
571 ui_test_utils::RunMessageLoop(); | 571 content::RunMessageLoop(); |
572 return delegate.running(); | 572 return delegate.running(); |
573 } | 573 } |
574 | 574 |
575 void SyncTest::EnableNetwork(Profile* profile) { | 575 void SyncTest::EnableNetwork(Profile* profile) { |
576 SetProxyConfig(profile->GetRequestContext(), | 576 SetProxyConfig(profile->GetRequestContext(), |
577 net::ProxyConfig::CreateDirect()); | 577 net::ProxyConfig::CreateDirect()); |
578 if (notifications_enabled_) { | 578 if (notifications_enabled_) { |
579 EnableNotificationsImpl(); | 579 EnableNotificationsImpl(); |
580 } | 580 } |
581 // TODO(rsimha): Remove this line once http://crbug.com/53857 is fixed. | 581 // TODO(rsimha): Remove this line once http://crbug.com/53857 is fixed. |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 | 785 |
786 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, | 786 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, |
787 const net::ProxyConfig& proxy_config) { | 787 const net::ProxyConfig& proxy_config) { |
788 base::WaitableEvent done(false, false); | 788 base::WaitableEvent done(false, false); |
789 BrowserThread::PostTask( | 789 BrowserThread::PostTask( |
790 BrowserThread::IO, FROM_HERE, | 790 BrowserThread::IO, FROM_HERE, |
791 base::Bind(&SetProxyConfigCallback, &done, | 791 base::Bind(&SetProxyConfigCallback, &done, |
792 make_scoped_refptr(context_getter), proxy_config)); | 792 make_scoped_refptr(context_getter), proxy_config)); |
793 done.Wait(); | 793 done.Wait(); |
794 } | 794 } |
OLD | NEW |