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