OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERER_MEDIA_MOCK_MEDIA_STREAM_VIDEO_SOURCE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_VIDEO_SOURCE_H_ |
6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_VIDEO_SOURCE_H_ | 6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_VIDEO_SOURCE_H_ |
7 | 7 |
8 #include "content/renderer/media/media_stream_video_source.h" | 8 #include "content/renderer/media/media_stream_video_source.h" |
9 | 9 |
| 10 #include "testing/gmock/include/gmock/gmock.h" |
| 11 |
10 namespace content { | 12 namespace content { |
11 | 13 |
12 class MockMediaStreamVideoSource : public MediaStreamVideoSource { | 14 class MockMediaStreamVideoSource : public MediaStreamVideoSource { |
13 public: | 15 public: |
14 explicit MockMediaStreamVideoSource(bool manual_get_supported_formats); | 16 explicit MockMediaStreamVideoSource(bool manual_get_supported_formats); |
15 virtual ~MockMediaStreamVideoSource(); | 17 virtual ~MockMediaStreamVideoSource(); |
16 | 18 |
| 19 MOCK_METHOD1(SetMutedState, void(bool muted_state)); |
| 20 |
17 // Simulate that the underlying source start successfully. | 21 // Simulate that the underlying source start successfully. |
18 void StartMockedSource(); | 22 void StartMockedSource(); |
19 | 23 |
20 // Simulate that the underlying source fail to start. | 24 // Simulate that the underlying source fail to start. |
21 void FailToStartMockedSource(); | 25 void FailToStartMockedSource(); |
22 | 26 |
23 // Returns true if StartSource has been called and StartMockedSource | 27 // Returns true if StartSource has been called and StartMockedSource |
24 // or FailToStartMockedSource has not been called. | 28 // or FailToStartMockedSource has not been called. |
25 bool SourceHasAttemptedToStart() { return attempted_to_start_; } | 29 bool SourceHasAttemptedToStart() { return attempted_to_start_; } |
26 | 30 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 bool attempted_to_start_; | 68 bool attempted_to_start_; |
65 VideoCaptureDeviceFormatsCB formats_callback_; | 69 VideoCaptureDeviceFormatsCB formats_callback_; |
66 VideoCaptureDeliverFrameCB frame_callback_; | 70 VideoCaptureDeliverFrameCB frame_callback_; |
67 | 71 |
68 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamVideoSource); | 72 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamVideoSource); |
69 }; | 73 }; |
70 | 74 |
71 } // namespace content | 75 } // namespace content |
72 | 76 |
73 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_VIDEO_SOURCE_H_ | 77 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_VIDEO_SOURCE_H_ |
OLD | NEW |