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 "base/memory/shared_memory.h" | 5 #include "base/memory/shared_memory.h" |
6 #include "content/common/media/video_capture_messages.h" | 6 #include "content/common/media/video_capture_messages.h" |
7 #include "content/renderer/media/video_capture_message_filter.h" | 7 #include "content/renderer/media/video_capture_message_filter.h" |
8 #include "ipc/ipc_test_sink.h" | 8 #include "ipc/ipc_test_sink.h" |
9 #include "media/base/video_capture_types.h" | 9 #include "media/base/video_capture_types.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 const gpu::MailboxHolder& mailbox_holder, | 43 const gpu::MailboxHolder& mailbox_holder, |
44 const gfx::Size& packed_frame_size, | 44 const gfx::Size& packed_frame_size, |
45 base::TimeTicks timestamp, | 45 base::TimeTicks timestamp, |
46 const base::DictionaryValue& metadata)); | 46 const base::DictionaryValue& metadata)); |
47 MOCK_METHOD1(OnStateChanged, void(VideoCaptureState state)); | 47 MOCK_METHOD1(OnStateChanged, void(VideoCaptureState state)); |
48 MOCK_METHOD1(OnDeviceSupportedFormatsEnumerated, | 48 MOCK_METHOD1(OnDeviceSupportedFormatsEnumerated, |
49 void(const media::VideoCaptureFormats& formats)); | 49 void(const media::VideoCaptureFormats& formats)); |
50 MOCK_METHOD1(OnDeviceFormatsInUseReceived, | 50 MOCK_METHOD1(OnDeviceFormatsInUseReceived, |
51 void(const media::VideoCaptureFormats& formats_in_use)); | 51 void(const media::VideoCaptureFormats& formats_in_use)); |
52 | 52 |
53 virtual void OnDelegateAdded(int32 device_id) override { | 53 void OnDelegateAdded(int32 device_id) override { |
54 ASSERT_TRUE(device_id != 0); | 54 ASSERT_TRUE(device_id != 0); |
55 ASSERT_TRUE(device_id_ == 0); | 55 ASSERT_TRUE(device_id_ == 0); |
56 device_id_ = device_id; | 56 device_id_ = device_id; |
57 } | 57 } |
58 | 58 |
59 int device_id() { return device_id_; } | 59 int device_id() { return device_id_; } |
60 | 60 |
61 private: | 61 private: |
62 int device_id_; | 62 int device_id_; |
63 }; | 63 }; |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 MockVideoCaptureDelegate delegate; | 221 MockVideoCaptureDelegate delegate; |
222 filter->AddDelegate(&delegate); | 222 filter->AddDelegate(&delegate); |
223 ASSERT_EQ(1, delegate.device_id()); | 223 ASSERT_EQ(1, delegate.device_id()); |
224 | 224 |
225 EXPECT_CALL(delegate, OnDeviceFormatsInUseReceived(_)); | 225 EXPECT_CALL(delegate, OnDeviceFormatsInUseReceived(_)); |
226 media::VideoCaptureFormats formats_in_use; | 226 media::VideoCaptureFormats formats_in_use; |
227 filter->OnMessageReceived(VideoCaptureMsg_DeviceFormatsInUseReceived( | 227 filter->OnMessageReceived(VideoCaptureMsg_DeviceFormatsInUseReceived( |
228 delegate.device_id(), formats_in_use)); | 228 delegate.device_id(), formats_in_use)); |
229 } | 229 } |
230 } // namespace content | 230 } // namespace content |
OLD | NEW |