| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 class SyncServerStatusChecker : public net::URLFetcherDelegate { | 72 class SyncServerStatusChecker : public net::URLFetcherDelegate { |
| 73 public: | 73 public: |
| 74 SyncServerStatusChecker() : running_(false) {} | 74 SyncServerStatusChecker() : running_(false) {} |
| 75 | 75 |
| 76 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE { | 76 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE { |
| 77 std::string data; | 77 std::string data; |
| 78 source->GetResponseAsString(&data); | 78 source->GetResponseAsString(&data); |
| 79 running_ = | 79 running_ = |
| 80 (source->GetStatus().status() == net::URLRequestStatus::SUCCESS && | 80 (source->GetStatus().status() == net::URLRequestStatus::SUCCESS && |
| 81 source->GetResponseCode() == 200 && data.find("ok") == 0); | 81 source->GetResponseCode() == 200 && data.find("ok") == 0); |
| 82 MessageLoop::current()->Quit(); | 82 base::MessageLoop::current()->Quit(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 bool running() const { return running_; } | 85 bool running() const { return running_; } |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 bool running_; | 88 bool running_; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 void SetProxyConfigCallback( | 91 void SetProxyConfigCallback( |
| 92 base::WaitableEvent* done, | 92 base::WaitableEvent* done, |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 | 848 |
| 849 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, | 849 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, |
| 850 const net::ProxyConfig& proxy_config) { | 850 const net::ProxyConfig& proxy_config) { |
| 851 base::WaitableEvent done(false, false); | 851 base::WaitableEvent done(false, false); |
| 852 BrowserThread::PostTask( | 852 BrowserThread::PostTask( |
| 853 BrowserThread::IO, FROM_HERE, | 853 BrowserThread::IO, FROM_HERE, |
| 854 base::Bind(&SetProxyConfigCallback, &done, | 854 base::Bind(&SetProxyConfigCallback, &done, |
| 855 make_scoped_refptr(context_getter), proxy_config)); | 855 make_scoped_refptr(context_getter), proxy_config)); |
| 856 done.Wait(); | 856 done.Wait(); |
| 857 } | 857 } |
| OLD | NEW |