blob: 17673b5cc0eb6a4303d121af31ab1f740332dba8 [file] [log] [blame]
sergeyu@chromium.org6c82a7e2013-06-04 18:51:23 +00001/*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_SCREEN_CAPTURER_MOCK_OBJECTS_H_
12#define WEBRTC_MODULES_DESKTOP_CAPTURE_SCREEN_CAPTURER_MOCK_OBJECTS_H_
13
14#include "testing/gmock/include/gmock/gmock.h"
15#include "webrtc/modules/desktop_capture/mouse_cursor_shape.h"
16#include "webrtc/modules/desktop_capture/screen_capturer.h"
17
18namespace webrtc {
19
20class MockScreenCapturer : public ScreenCapturer {
21 public:
22 MockScreenCapturer() {}
23 virtual ~MockScreenCapturer() {}
24
25 MOCK_METHOD1(Start, void(Callback* callback));
26 MOCK_METHOD1(Capture, void(const DesktopRegion& region));
27 MOCK_METHOD1(SetMouseShapeObserver, void(
28 MouseShapeObserver* mouse_shape_observer));
29
30 private:
31 DISALLOW_COPY_AND_ASSIGN(MockScreenCapturer);
32};
33
34class MockScreenCapturerCallback : public ScreenCapturer::Callback {
35 public:
36 MockScreenCapturerCallback() {}
37 virtual ~MockScreenCapturerCallback() {}
38
39 MOCK_METHOD1(CreateSharedMemory, SharedMemory*(size_t));
40 MOCK_METHOD1(OnCaptureCompleted, void(DesktopFrame*));
41
42 private:
43 DISALLOW_COPY_AND_ASSIGN(MockScreenCapturerCallback);
44};
45
46class MockMouseShapeObserver : public ScreenCapturer::MouseShapeObserver {
47 public:
48 MockMouseShapeObserver() {}
49 virtual ~MockMouseShapeObserver() {}
50
51 void OnCursorShapeChanged(MouseCursorShape* cursor_shape) OVERRIDE {
52 OnCursorShapeChangedPtr(cursor_shape);
53 delete cursor_shape;
54 }
55
56 MOCK_METHOD1(OnCursorShapeChangedPtr,
57 void(MouseCursorShape* cursor_shape));
58
59 private:
60 DISALLOW_COPY_AND_ASSIGN(MockMouseShapeObserver);
61};
62
63
64} // namespace webrtc
65
66#endif // WEBRTC_MODULES_DESKTOP_CAPTURE_SCREEN_CAPTURER_MOCK_OBJECTS_H_