OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MEDIA_OBSERVER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOCK_MEDIA_OBSERVER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOCK_MEDIA_OBSERVER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOCK_MEDIA_OBSERVER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "content/browser/media/media_internals.h" | |
11 #include "content/public/browser/media_observer.h" | 12 #include "content/public/browser/media_observer.h" |
12 #include "media/base/media_log_event.h" | 13 #include "media/base/media_log_event.h" |
13 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
14 | 15 |
15 namespace content { | 16 namespace content { |
16 | 17 |
17 class MockMediaObserver : public MediaObserver { | 18 class MockMediaObserver : public MediaObserver { |
18 public: | 19 public: |
19 MockMediaObserver(); | 20 MockMediaObserver(); |
20 virtual ~MockMediaObserver(); | 21 virtual ~MockMediaObserver(); |
21 | 22 |
22 MOCK_METHOD2(OnDeleteAudioStream, | |
23 void(void* host, int stream_id)); | |
24 MOCK_METHOD3(OnSetAudioStreamPlaying, | |
25 void(void* host, int stream_id, bool playing)); | |
26 MOCK_METHOD3(OnSetAudioStreamStatus, | |
27 void(void* host, int stream_id, const std::string& status)); | |
28 MOCK_METHOD3(OnSetAudioStreamVolume, | |
29 void(void* host, int stream_id, double volume)); | |
30 MOCK_METHOD2(OnMediaEvent, | |
31 void(int source, const media::MediaLogEvent& event)); | |
32 MOCK_METHOD3(OnCaptureDevicesOpened, | 23 MOCK_METHOD3(OnCaptureDevicesOpened, |
33 void(int render_process_id, int render_view_id, | 24 void(int render_process_id, int render_view_id, |
34 const MediaStreamDevices& devices)); | 25 const MediaStreamDevices& devices)); |
35 MOCK_METHOD3(OnCaptureDevicesClosed, | 26 MOCK_METHOD3(OnCaptureDevicesClosed, |
36 void(int render_process_id, int render_view_id, | 27 void(int render_process_id, int render_view_id, |
37 const MediaStreamDevices& devices)); | 28 const MediaStreamDevices& devices)); |
38 MOCK_METHOD1(OnAudioCaptureDevicesChanged, | 29 MOCK_METHOD1(OnAudioCaptureDevicesChanged, |
39 void(const MediaStreamDevices& devices)); | 30 void(const MediaStreamDevices& devices)); |
40 MOCK_METHOD1(OnVideoCaptureDevicesChanged, | 31 MOCK_METHOD1(OnVideoCaptureDevicesChanged, |
41 void(const MediaStreamDevices& devices)); | 32 void(const MediaStreamDevices& devices)); |
42 MOCK_METHOD4(OnMediaRequestStateChanged, | 33 MOCK_METHOD4(OnMediaRequestStateChanged, |
43 void(int render_process_id, int render_view_id, | 34 void(int render_process_id, int render_view_id, |
44 const MediaStreamDevice& device, | 35 const MediaStreamDevice& device, |
45 const MediaRequestState state)); | 36 const MediaRequestState state)); |
46 }; | 37 }; |
47 | 38 |
39 class MockMediaInternals : public MediaInternals { | |
scherkus (not reviewing)
2013/02/01 02:05:17
hmmmm I wonder how useful these mocks object are..
jam
2013/02/01 02:18:22
i strongly dislike gmock :)
| |
40 public: | |
41 MockMediaInternals(); | |
42 virtual ~MockMediaInternals(); | |
43 | |
44 MOCK_METHOD2(OnDeleteAudioStream, | |
45 void(void* host, int stream_id)); | |
46 MOCK_METHOD3(OnSetAudioStreamPlaying, | |
47 void(void* host, int stream_id, bool playing)); | |
48 MOCK_METHOD3(OnSetAudioStreamStatus, | |
49 void(void* host, int stream_id, const std::string& status)); | |
50 MOCK_METHOD3(OnSetAudioStreamVolume, | |
51 void(void* host, int stream_id, double volume)); | |
52 MOCK_METHOD2(OnMediaEvent, | |
53 void(int source, const media::MediaLogEvent& event)); | |
54 }; | |
55 | |
48 } // namespace content | 56 } // namespace content |
49 | 57 |
50 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOCK_MEDIA_OBSERVER_H_ | 58 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOCK_MEDIA_OBSERVER_H_ |
OLD | NEW |