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.
5 #ifndef CHROME_BROWSER_SYNC_TEST_TEST_HTTP_BRIDGE_FACTORY_H_
6 #define CHROME_BROWSER_SYNC_TEST_TEST_HTTP_BRIDGE_FACTORY_H_
8 #include "base/compiler_specific.h"
9 #include "sync/internal_api/public/http_post_provider_factory.h"
10 #include "sync/internal_api/public/http_post_provider_interface.h"
12 namespace browser_sync
{
14 class TestHttpBridge
: public syncer::HttpPostProviderInterface
{
16 // Begin syncer::HttpPostProviderInterface implementation:
17 void SetExtraRequestHeaders(const char* headers
) override
{}
19 void SetURL(const char* url
, int port
) override
{}
21 void SetPostPayload(const char* content_type
,
23 const char* content
) override
{}
25 bool MakeSynchronousPost(int* error_code
, int* response_code
) override
;
27 int GetResponseContentLength() const override
;
29 const char* GetResponseContent() const override
;
31 const std::string
GetResponseHeaderValue(const std::string
&) const override
;
33 void Abort() override
;
34 // End syncer::HttpPostProviderInterface implementation.
37 class TestHttpBridgeFactory
: public syncer::HttpPostProviderFactory
{
39 TestHttpBridgeFactory();
40 ~TestHttpBridgeFactory() override
;
42 // syncer::HttpPostProviderFactory:
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
;
50 } // namespace browser_sync
52 #endif // CHROME_BROWSER_SYNC_TEST_TEST_HTTP_BRIDGE_FACTORY_H_