| 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 "sync/internal_api/syncapi_server_connection_manager.h" | 5 #include "sync/internal_api/syncapi_server_connection_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 virtual void Abort() OVERRIDE { | 51 virtual void Abort() OVERRIDE { |
| 52 wait_for_abort_.Signal(); | 52 wait_for_abort_.Signal(); |
| 53 } | 53 } |
| 54 private: | 54 private: |
| 55 base::WaitableEvent wait_for_abort_; | 55 base::WaitableEvent wait_for_abort_; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 class BlockingHttpPostFactory : public HttpPostProviderFactory { | 58 class BlockingHttpPostFactory : public HttpPostProviderFactory { |
| 59 public: | 59 public: |
| 60 virtual ~BlockingHttpPostFactory() {} | 60 virtual ~BlockingHttpPostFactory() {} |
| 61 virtual void RegisterCancelationSignal(CancelationSignal* cancelation_signal) |
| 62 OVERRIDE {} |
| 61 virtual void Init(const std::string& user_agent) OVERRIDE {} | 63 virtual void Init(const std::string& user_agent) OVERRIDE {} |
| 62 virtual HttpPostProviderInterface* Create() OVERRIDE { | 64 virtual HttpPostProviderInterface* Create() OVERRIDE { |
| 63 return new BlockingHttpPost(); | 65 return new BlockingHttpPost(); |
| 64 } | 66 } |
| 65 virtual void Destroy(HttpPostProviderInterface* http) OVERRIDE { | 67 virtual void Destroy(HttpPostProviderInterface* http) OVERRIDE { |
| 66 delete static_cast<BlockingHttpPost*>(http); | 68 delete static_cast<BlockingHttpPost*>(http); |
| 67 } | 69 } |
| 68 }; | 70 }; |
| 69 | 71 |
| 70 } // namespace | 72 } // namespace |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 bool result = server.PostBufferToPath( | 127 bool result = server.PostBufferToPath( |
| 126 ¶ms, "/testpath", "testauth", &watcher); | 128 ¶ms, "/testpath", "testauth", &watcher); |
| 127 | 129 |
| 128 EXPECT_FALSE(result); | 130 EXPECT_FALSE(result); |
| 129 EXPECT_EQ(HttpResponse::CONNECTION_UNAVAILABLE, | 131 EXPECT_EQ(HttpResponse::CONNECTION_UNAVAILABLE, |
| 130 params.response.server_status); | 132 params.response.server_status); |
| 131 abort_thread.Stop(); | 133 abort_thread.Stop(); |
| 132 } | 134 } |
| 133 | 135 |
| 134 } // namespace syncer | 136 } // namespace syncer |
| OLD | NEW |