summaryrefslogtreecommitdiffstats
path: root/content/test/mock_weburlloader.h
blob: 3518b67b18ff24d4b3acccd5f825324a3b4be54d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_TEST_MOCK_WEBURLLOADER_H_
#define CONTENT_TEST_MOCK_WEBURLLOADER_H_

#include "base/macros.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/WebKit/public/platform/WebURLLoader.h"

namespace content {

class MockWebURLLoader : public blink::WebURLLoader {
 public:
  MockWebURLLoader();
  virtual ~MockWebURLLoader();

  MOCK_METHOD4(loadSynchronously, void(const blink::WebURLRequest& request,
                                       blink::WebURLResponse& response,
                                       blink::WebURLError& error,
                                       blink::WebData& data));
  MOCK_METHOD2(loadAsynchronously, void(const blink::WebURLRequest& request,
                                        blink::WebURLLoaderClient* client));
  MOCK_METHOD0(cancel, void());
  MOCK_METHOD1(setDefersLoading, void(bool value));
  MOCK_METHOD1(setLoadingTaskRunner,
               void(blink::WebTaskRunner* loading_task_runner));

 private:
  DISALLOW_COPY_AND_ASSIGN(MockWebURLLoader);
};

}  // namespace content

#endif  // CONTENT_TEST_MOCK_WEBURLLOADER_H_