| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 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 CHROME_TEST_SYNC_TEST_HTTP_BRIDGE_FACTORY_H_ | |
| 6 #define CHROME_TEST_SYNC_TEST_HTTP_BRIDGE_FACTORY_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "chrome/browser/sync/internal_api/http_post_provider_interface.h" | |
| 11 #include "chrome/browser/sync/internal_api/http_post_provider_factory.h" | |
| 12 | |
| 13 namespace browser_sync { | |
| 14 | |
| 15 class TestHttpBridge : public sync_api::HttpPostProviderInterface { | |
| 16 public: | |
| 17 // Begin sync_api::HttpPostProviderInterface implementation: | |
| 18 virtual void SetUserAgent(const char* user_agent) OVERRIDE {} | |
| 19 | |
| 20 virtual void SetExtraRequestHeaders(const char * headers) OVERRIDE {} | |
| 21 | |
| 22 virtual void SetURL(const char* url, int port) OVERRIDE {} | |
| 23 | |
| 24 virtual void SetPostPayload(const char* content_type, | |
| 25 int content_length, | |
| 26 const char* content) OVERRIDE {} | |
| 27 | |
| 28 virtual bool MakeSynchronousPost(int* os_error_code, | |
| 29 int* response_code) OVERRIDE; | |
| 30 | |
| 31 virtual int GetResponseContentLength() const OVERRIDE; | |
| 32 | |
| 33 virtual const char* GetResponseContent() const OVERRIDE; | |
| 34 | |
| 35 virtual const std::string GetResponseHeaderValue( | |
| 36 const std::string&) const OVERRIDE; | |
| 37 | |
| 38 virtual void Abort(); | |
| 39 // End sync_api::HttpPostProviderInterface implementation. | |
| 40 }; | |
| 41 | |
| 42 class TestHttpBridgeFactory : public sync_api::HttpPostProviderFactory { | |
| 43 public: | |
| 44 TestHttpBridgeFactory(); | |
| 45 virtual ~TestHttpBridgeFactory(); | |
| 46 | |
| 47 // sync_api::HttpPostProviderFactory: | |
| 48 virtual sync_api::HttpPostProviderInterface* Create() OVERRIDE; | |
| 49 virtual void Destroy(sync_api::HttpPostProviderInterface* http) OVERRIDE; | |
| 50 }; | |
| 51 | |
| 52 } // namespace browser_sync | |
| 53 | |
| 54 #endif // CHROME_TEST_SYNC_TEST_HTTP_BRIDGE_FACTORY_H_ | |
| OLD | NEW |