Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: content/browser/renderer_host/media/mock_video_capture_provider.h

Issue 2902203002: [Mojo Video Capture] Hook up connection lost events (Closed)
Patch Set: Fix duplicate member introduced during merging Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOCK_VIDEO_CAPTURE_PROVIDER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOCK_VIDEO_CAPTURE_PROVIDER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOCK_VIDEO_CAPTURE_PROVIDER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOCK_VIDEO_CAPTURE_PROVIDER_H_
7 7
8 #include "content/browser/renderer_host/media/video_capture_provider.h" 8 #include "content/browser/renderer_host/media/video_capture_provider.h"
9 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
10 10
(...skipping 12 matching lines...) Expand all
23 23
24 MOCK_METHOD0(CreateDeviceLauncher, 24 MOCK_METHOD0(CreateDeviceLauncher,
25 std::unique_ptr<VideoCaptureDeviceLauncher>()); 25 std::unique_ptr<VideoCaptureDeviceLauncher>());
26 }; 26 };
27 27
28 class MockVideoCaptureDeviceLauncher : public VideoCaptureDeviceLauncher { 28 class MockVideoCaptureDeviceLauncher : public VideoCaptureDeviceLauncher {
29 public: 29 public:
30 MockVideoCaptureDeviceLauncher(); 30 MockVideoCaptureDeviceLauncher();
31 ~MockVideoCaptureDeviceLauncher() override; 31 ~MockVideoCaptureDeviceLauncher() override;
32 32
33 MOCK_METHOD6(DoLaunchDeviceAsync, 33 MOCK_METHOD7(DoLaunchDeviceAsync,
34 void(const std::string& device_id, 34 void(const std::string& device_id,
35 MediaStreamType stream_type, 35 MediaStreamType stream_type,
36 const media::VideoCaptureParams& params, 36 const media::VideoCaptureParams& params,
37 base::WeakPtr<media::VideoFrameReceiver>* receiver, 37 base::WeakPtr<media::VideoFrameReceiver>* receiver,
38 base::OnceClosure* connection_lost_cb,
38 Callbacks* callbacks, 39 Callbacks* callbacks,
39 base::OnceClosure* done_cb)); 40 base::OnceClosure* done_cb));
40 41
41 MOCK_METHOD0(AbortLaunch, void()); 42 MOCK_METHOD0(AbortLaunch, void());
42 43
43 void LaunchDeviceAsync(const std::string& device_id, 44 void LaunchDeviceAsync(const std::string& device_id,
44 MediaStreamType stream_type, 45 MediaStreamType stream_type,
45 const media::VideoCaptureParams& params, 46 const media::VideoCaptureParams& params,
46 base::WeakPtr<media::VideoFrameReceiver> receiver, 47 base::WeakPtr<media::VideoFrameReceiver> receiver,
48 base::OnceClosure connection_lost_cb,
47 Callbacks* callbacks, 49 Callbacks* callbacks,
48 base::OnceClosure done_cb) override { 50 base::OnceClosure done_cb) override {
49 DoLaunchDeviceAsync(device_id, stream_type, params, &receiver, callbacks, 51 DoLaunchDeviceAsync(device_id, stream_type, params, &receiver,
50 &done_cb); 52 &connection_lost_cb, callbacks, &done_cb);
51 } 53 }
52 }; 54 };
53 55
54 class MockLaunchedVideoCaptureDevice : public LaunchedVideoCaptureDevice { 56 class MockLaunchedVideoCaptureDevice : public LaunchedVideoCaptureDevice {
55 public: 57 public:
56 MockLaunchedVideoCaptureDevice(); 58 MockLaunchedVideoCaptureDevice();
57 ~MockLaunchedVideoCaptureDevice() override; 59 ~MockLaunchedVideoCaptureDevice() override;
58 60
59 MOCK_CONST_METHOD1( 61 MOCK_CONST_METHOD1(
60 DoGetPhotoCapabilities, 62 DoGetPhotoCapabilities,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 94
93 void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id, 95 void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id,
94 base::OnceClosure done_cb) override { 96 base::OnceClosure done_cb) override {
95 DoSetDesktopCaptureWindowId(window_id, &done_cb); 97 DoSetDesktopCaptureWindowId(window_id, &done_cb);
96 } 98 }
97 }; 99 };
98 100
99 } // namespace content 101 } // namespace content
100 102
101 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOCK_VIDEO_CAPTURE_PROVIDER_H_ 103 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOCK_VIDEO_CAPTURE_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698