Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: sync/internal_api/syncapi_server_connection_manager_unittest.cc

Issue 73723006: Allow customization of HttpPostProviderFactory via ProfileSyncService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
125 bool result = server.PostBufferToPath( 127 bool result = server.PostBufferToPath(
126 &params, "/testpath", "testauth", &watcher); 128 &params, "/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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698