OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_BROWSER_SYNC_BROWSER_TEST_HTTP_BRIDGE_FACTORY_H_ | |
6 #define COMPONENTS_BROWSER_SYNC_BROWSER_TEST_HTTP_BRIDGE_FACTORY_H_ | |
7 | |
8 #include "base/compiler_specific.h" | |
9 #include "components/sync/core/http_post_provider_factory.h" | |
10 #include "components/sync/core/http_post_provider_interface.h" | |
11 | |
12 namespace browser_sync { | |
13 | |
14 class TestHttpBridge : public syncer::HttpPostProviderInterface { | |
15 public: | |
16 // Begin syncer::HttpPostProviderInterface implementation: | |
17 void SetExtraRequestHeaders(const char* headers) override {} | |
18 | |
19 void SetURL(const char* url, int port) override {} | |
20 | |
21 void SetPostPayload(const char* content_type, | |
22 int content_length, | |
23 const char* content) override {} | |
24 | |
25 bool MakeSynchronousPost(int* error_code, int* response_code) override; | |
26 | |
27 int GetResponseContentLength() const override; | |
28 | |
29 const char* GetResponseContent() const override; | |
30 | |
31 const std::string GetResponseHeaderValue(const std::string&) const override; | |
32 | |
33 void Abort() override; | |
34 // End syncer::HttpPostProviderInterface implementation. | |
35 }; | |
36 | |
37 class TestHttpBridgeFactory : public syncer::HttpPostProviderFactory { | |
38 public: | |
39 TestHttpBridgeFactory(); | |
40 ~TestHttpBridgeFactory() override; | |
41 | |
42 // syncer::HttpPostProviderFactory: | |
43 void Init( | |
44 const std::string& user_agent, | |
45 const syncer::BindToTrackerCallback& bind_to_tracker_callback) override; | |
46 syncer::HttpPostProviderInterface* Create() override; | |
47 void Destroy(syncer::HttpPostProviderInterface* http) override; | |
48 }; | |
49 | |
50 } // namespace browser_sync | |
51 | |
52 #endif // COMPONENTS_BROWSER_SYNC_BROWSER_TEST_HTTP_BRIDGE_FACTORY_H_ | |
OLD | NEW |