Paul Stewart | e692740 | 2012-01-23 16:11:30 -0800 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS 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 SHILL_MOCK_HTTP_REQUEST_H_ |
| 6 | #define SHILL_MOCK_HTTP_REQUEST_H_ |
| 7 | |
| 8 | #include <base/basictypes.h> |
| 9 | #include <gmock/gmock.h> |
| 10 | |
| 11 | #include "shill/http_request.h" |
| 12 | #include "shill/http_url.h" // MOCK_METHOD3() call below needs sizeof(HTTPURL). |
| 13 | |
| 14 | namespace shill { |
| 15 | |
| 16 | class MockHTTPRequest : public HTTPRequest { |
| 17 | public: |
| 18 | MockHTTPRequest(ConnectionRefPtr connection); |
| 19 | virtual ~MockHTTPRequest(); |
| 20 | |
| 21 | MOCK_METHOD3(Start, HTTPRequest::Result( |
| 22 | const HTTPURL &url, |
Eric Shienbrood | 3e20a23 | 2012-02-16 11:35:56 -0500 | [diff] [blame] | 23 | const base::Callback<void(const ByteString &)> &read_event_callback, |
| 24 | const base::Callback<void(Result, const ByteString &)> &result_callback)); |
Paul Stewart | e692740 | 2012-01-23 16:11:30 -0800 | [diff] [blame] | 25 | MOCK_METHOD0(Stop, void()); |
| 26 | MOCK_CONST_METHOD0(response_data, const ByteString &()); |
| 27 | |
| 28 | private: |
| 29 | DISALLOW_COPY_AND_ASSIGN(MockHTTPRequest); |
| 30 | }; |
| 31 | |
| 32 | } // namespace shill |
| 33 | |
| 34 | #endif // SHILL_MOCK_HTTP_REQUEST_H_ |