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 #include <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include "base/memory/shared_memory.h" | 7 #include "base/memory/shared_memory.h" |
8 #include "base/process/process_handle.h" | 8 #include "base/process/process_handle.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "content/common/media/video_capture_messages.h" | 10 #include "content/common/media/video_capture_messages.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 class MockVideoCaptureDelegate : public VideoCaptureMessageFilter::Delegate { | 30 class MockVideoCaptureDelegate : public VideoCaptureMessageFilter::Delegate { |
31 public: | 31 public: |
32 MockVideoCaptureDelegate() : device_id_(0) {} | 32 MockVideoCaptureDelegate() : device_id_(0) {} |
33 | 33 |
34 // VideoCaptureMessageFilter::Delegate implementation. | 34 // VideoCaptureMessageFilter::Delegate implementation. |
35 MOCK_METHOD3(OnBufferCreated, | 35 MOCK_METHOD3(OnBufferCreated, |
36 void(base::SharedMemoryHandle handle, | 36 void(base::SharedMemoryHandle handle, |
37 int length, | 37 int length, |
38 int buffer_id)); | 38 int buffer_id)); |
39 MOCK_METHOD3(OnBufferCreated2, | 39 MOCK_METHOD4(OnBufferCreated2, |
40 void(const std::vector<gfx::GpuMemoryBufferHandle>& handles, | 40 void(const std::vector<gfx::GpuMemoryBufferHandle>& handles, |
41 const gfx::Size& size, | 41 const gfx::Size& size, |
| 42 media::VideoPixelFormat format, |
42 int buffer_id)); | 43 int buffer_id)); |
43 MOCK_METHOD1(OnBufferDestroyed, void(int buffer_id)); | 44 MOCK_METHOD1(OnBufferDestroyed, void(int buffer_id)); |
44 MOCK_METHOD7(OnBufferReceived, | 45 MOCK_METHOD7(OnBufferReceived, |
45 void(int buffer_id, | 46 void(int buffer_id, |
46 base::TimeDelta timestamp, | 47 base::TimeDelta timestamp, |
47 const base::DictionaryValue& metadata, | 48 const base::DictionaryValue& metadata, |
48 media::VideoPixelFormat pixel_format, | 49 media::VideoPixelFormat pixel_format, |
49 media::VideoFrame::StorageType storage_type, | 50 media::VideoFrame::StorageType storage_type, |
50 const gfx::Size& coded_size, | 51 const gfx::Size& coded_size, |
51 const gfx::Rect& visible_rect)); | 52 const gfx::Rect& visible_rect)); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 MockVideoCaptureDelegate delegate; | 215 MockVideoCaptureDelegate delegate; |
215 filter->AddDelegate(&delegate); | 216 filter->AddDelegate(&delegate); |
216 ASSERT_EQ(1, delegate.device_id()); | 217 ASSERT_EQ(1, delegate.device_id()); |
217 | 218 |
218 EXPECT_CALL(delegate, OnDeviceFormatsInUseReceived(_)); | 219 EXPECT_CALL(delegate, OnDeviceFormatsInUseReceived(_)); |
219 media::VideoCaptureFormats formats_in_use; | 220 media::VideoCaptureFormats formats_in_use; |
220 filter->OnMessageReceived(VideoCaptureMsg_DeviceFormatsInUseReceived( | 221 filter->OnMessageReceived(VideoCaptureMsg_DeviceFormatsInUseReceived( |
221 delegate.device_id(), formats_in_use)); | 222 delegate.device_id(), formats_in_use)); |
222 } | 223 } |
223 } // namespace content | 224 } // namespace content |
OLD | NEW |