blob: 54439dfe92a6f98a8fbecbc7c9ab4a04cb6ca367 [file] [log] [blame]
Paul Stewarte6927402012-01-23 16:11:30 -08001// 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
Ben Chancc67c522014-09-03 07:19:18 -07008#include <base/macros.h>
Paul Stewarte6927402012-01-23 16:11:30 -08009#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
14namespace shill {
15
16class MockHTTPRequest : public HTTPRequest {
17 public:
Alex Vakulenko8a532292014-06-16 17:18:44 -070018 explicit MockHTTPRequest(ConnectionRefPtr connection);
Ben Chan5ea763b2014-08-13 11:07:54 -070019 ~MockHTTPRequest() override;
Paul Stewarte6927402012-01-23 16:11:30 -080020
21 MOCK_METHOD3(Start, HTTPRequest::Result(
Paul Stewart1e006c62015-06-16 12:29:06 -070022 const HTTPURL& url,
23 const base::Callback<void(const ByteString&)>& read_event_callback,
24 const base::Callback<void(Result, const ByteString&)>& result_callback));
Paul Stewarte6927402012-01-23 16:11:30 -080025 MOCK_METHOD0(Stop, void());
Paul Stewart1e006c62015-06-16 12:29:06 -070026 MOCK_CONST_METHOD0(response_data, const ByteString& ());
Paul Stewarte6927402012-01-23 16:11:30 -080027
28 private:
29 DISALLOW_COPY_AND_ASSIGN(MockHTTPRequest);
30};
31
32} // namespace shill
33
34#endif // SHILL_MOCK_HTTP_REQUEST_H_