OLD | NEW |
1 // Copyright (c) 2010 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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 const std::string kSyncServerCommandLine = "sync-server-command-line"; | 44 const std::string kSyncServerCommandLine = "sync-server-command-line"; |
45 } | 45 } |
46 | 46 |
47 // Helper class that checks whether a sync test server is running or not. | 47 // Helper class that checks whether a sync test server is running or not. |
48 class SyncServerStatusChecker : public URLFetcher::Delegate { | 48 class SyncServerStatusChecker : public URLFetcher::Delegate { |
49 public: | 49 public: |
50 SyncServerStatusChecker() : running_(false) {} | 50 SyncServerStatusChecker() : running_(false) {} |
51 | 51 |
52 virtual void OnURLFetchComplete(const URLFetcher* source, | 52 virtual void OnURLFetchComplete(const URLFetcher* source, |
53 const GURL& url, | 53 const GURL& url, |
54 const URLRequestStatus& status, | 54 const net::URLRequestStatus& status, |
55 int response_code, | 55 int response_code, |
56 const ResponseCookies& cookies, | 56 const ResponseCookies& cookies, |
57 const std::string& data) { | 57 const std::string& data) { |
58 running_ = (status.status() == URLRequestStatus::SUCCESS && | 58 running_ = (status.status() == net::URLRequestStatus::SUCCESS && |
59 response_code == 200 && data.find("ok") == 0); | 59 response_code == 200 && data.find("ok") == 0); |
60 MessageLoop::current()->Quit(); | 60 MessageLoop::current()->Quit(); |
61 } | 61 } |
62 | 62 |
63 bool running() const { return running_; } | 63 bool running() const { return running_; } |
64 | 64 |
65 private: | 65 private: |
66 bool running_; | 66 bool running_; |
67 }; | 67 }; |
68 | 68 |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 const net::ProxyConfig& proxy_config) { | 440 const net::ProxyConfig& proxy_config) { |
441 base::WaitableEvent done(false, false); | 441 base::WaitableEvent done(false, false); |
442 BrowserThread::PostTask( | 442 BrowserThread::PostTask( |
443 BrowserThread::IO, | 443 BrowserThread::IO, |
444 FROM_HERE, | 444 FROM_HERE, |
445 new SetProxyConfigTask(&done, | 445 new SetProxyConfigTask(&done, |
446 context_getter, | 446 context_getter, |
447 proxy_config)); | 447 proxy_config)); |
448 done.Wait(); | 448 done.Wait(); |
449 } | 449 } |
OLD | NEW |