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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 " \"expires_in\": 3600," | 77 " \"expires_in\": 3600," |
78 " \"token_type\": \"Bearer\"" | 78 " \"token_type\": \"Bearer\"" |
79 "}"; | 79 "}"; |
80 } | 80 } |
81 | 81 |
82 // Helper class that checks whether a sync test server is running or not. | 82 // Helper class that checks whether a sync test server is running or not. |
83 class SyncServerStatusChecker : public content::URLFetcherDelegate { | 83 class SyncServerStatusChecker : public content::URLFetcherDelegate { |
84 public: | 84 public: |
85 SyncServerStatusChecker() : running_(false) {} | 85 SyncServerStatusChecker() : running_(false) {} |
86 | 86 |
87 virtual void OnURLFetchComplete(const content::URLFetcher* source) { | 87 virtual void OnURLFetchComplete(const net::URLFetcher* source) { |
88 std::string data; | 88 std::string data; |
89 source->GetResponseAsString(&data); | 89 source->GetResponseAsString(&data); |
90 running_ = | 90 running_ = |
91 (source->GetStatus().status() == net::URLRequestStatus::SUCCESS && | 91 (source->GetStatus().status() == net::URLRequestStatus::SUCCESS && |
92 source->GetResponseCode() == 200 && data.find("ok") == 0); | 92 source->GetResponseCode() == 200 && data.find("ok") == 0); |
93 MessageLoop::current()->Quit(); | 93 MessageLoop::current()->Quit(); |
94 } | 94 } |
95 | 95 |
96 bool running() const { return running_; } | 96 bool running() const { return running_; } |
97 | 97 |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 | 786 |
787 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, | 787 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, |
788 const net::ProxyConfig& proxy_config) { | 788 const net::ProxyConfig& proxy_config) { |
789 base::WaitableEvent done(false, false); | 789 base::WaitableEvent done(false, false); |
790 BrowserThread::PostTask( | 790 BrowserThread::PostTask( |
791 BrowserThread::IO, FROM_HERE, | 791 BrowserThread::IO, FROM_HERE, |
792 base::Bind(&SetProxyConfigCallback, &done, | 792 base::Bind(&SetProxyConfigCallback, &done, |
793 make_scoped_refptr(context_getter), proxy_config)); | 793 make_scoped_refptr(context_getter), proxy_config)); |
794 done.Wait(); | 794 done.Wait(); |
795 } | 795 } |
OLD | NEW |