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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 return std::string(); | 44 return std::string(); |
45 } | 45 } |
46 void Abort() override { wait_for_abort_.Signal(); } | 46 void Abort() override { wait_for_abort_.Signal(); } |
47 private: | 47 private: |
48 base::WaitableEvent wait_for_abort_; | 48 base::WaitableEvent wait_for_abort_; |
49 }; | 49 }; |
50 | 50 |
51 class BlockingHttpPostFactory : public HttpPostProviderFactory { | 51 class BlockingHttpPostFactory : public HttpPostProviderFactory { |
52 public: | 52 public: |
53 ~BlockingHttpPostFactory() override {} | 53 ~BlockingHttpPostFactory() override {} |
54 void Init(const std::string& user_agent) override {} | 54 void Init(const std::string& user_agent, |
| 55 const BindToTrackerCallback& bind_to_tracker_callback) override {} |
| 56 |
55 HttpPostProviderInterface* Create() override { | 57 HttpPostProviderInterface* Create() override { |
56 return new BlockingHttpPost(); | 58 return new BlockingHttpPost(); |
57 } | 59 } |
58 void Destroy(HttpPostProviderInterface* http) override { | 60 void Destroy(HttpPostProviderInterface* http) override { |
59 delete static_cast<BlockingHttpPost*>(http); | 61 delete static_cast<BlockingHttpPost*>(http); |
60 } | 62 } |
61 }; | 63 }; |
62 | 64 |
63 } // namespace | 65 } // namespace |
64 | 66 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 bool result = server.PostBufferToPath( | 120 bool result = server.PostBufferToPath( |
119 ¶ms, "/testpath", "testauth", &watcher); | 121 ¶ms, "/testpath", "testauth", &watcher); |
120 | 122 |
121 EXPECT_FALSE(result); | 123 EXPECT_FALSE(result); |
122 EXPECT_EQ(HttpResponse::CONNECTION_UNAVAILABLE, | 124 EXPECT_EQ(HttpResponse::CONNECTION_UNAVAILABLE, |
123 params.response.server_status); | 125 params.response.server_status); |
124 abort_thread.Stop(); | 126 abort_thread.Stop(); |
125 } | 127 } |
126 | 128 |
127 } // namespace syncer | 129 } // namespace syncer |
OLD | NEW |