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/video/capture/video_capture_types.h" | 9 #include "media/video/capture/video_capture_types.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 void(int buffer_id, | 38 void(int buffer_id, |
39 const gpu::MailboxHolder& mailbox_holder, | 39 const gpu::MailboxHolder& mailbox_holder, |
40 const media::VideoCaptureFormat& format, | 40 const media::VideoCaptureFormat& format, |
41 base::TimeTicks timestamp)); | 41 base::TimeTicks timestamp)); |
42 MOCK_METHOD1(OnStateChanged, void(VideoCaptureState state)); | 42 MOCK_METHOD1(OnStateChanged, void(VideoCaptureState state)); |
43 MOCK_METHOD1(OnDeviceSupportedFormatsEnumerated, | 43 MOCK_METHOD1(OnDeviceSupportedFormatsEnumerated, |
44 void(const media::VideoCaptureFormats& formats)); | 44 void(const media::VideoCaptureFormats& formats)); |
45 MOCK_METHOD1(OnDeviceFormatsInUseReceived, | 45 MOCK_METHOD1(OnDeviceFormatsInUseReceived, |
46 void(const media::VideoCaptureFormats& formats_in_use)); | 46 void(const media::VideoCaptureFormats& formats_in_use)); |
47 | 47 |
48 virtual void OnDelegateAdded(int32 device_id) OVERRIDE { | 48 virtual void OnDelegateAdded(int32 device_id) override { |
49 ASSERT_TRUE(device_id != 0); | 49 ASSERT_TRUE(device_id != 0); |
50 ASSERT_TRUE(device_id_ == 0); | 50 ASSERT_TRUE(device_id_ == 0); |
51 device_id_ = device_id; | 51 device_id_ = device_id; |
52 } | 52 } |
53 | 53 |
54 int device_id() { return device_id_; } | 54 int device_id() { return device_id_; } |
55 | 55 |
56 private: | 56 private: |
57 int device_id_; | 57 int device_id_; |
58 }; | 58 }; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 MockVideoCaptureDelegate delegate; | 207 MockVideoCaptureDelegate delegate; |
208 filter->AddDelegate(&delegate); | 208 filter->AddDelegate(&delegate); |
209 ASSERT_EQ(1, delegate.device_id()); | 209 ASSERT_EQ(1, delegate.device_id()); |
210 | 210 |
211 EXPECT_CALL(delegate, OnDeviceFormatsInUseReceived(_)); | 211 EXPECT_CALL(delegate, OnDeviceFormatsInUseReceived(_)); |
212 media::VideoCaptureFormats formats_in_use; | 212 media::VideoCaptureFormats formats_in_use; |
213 filter->OnMessageReceived(VideoCaptureMsg_DeviceFormatsInUseReceived( | 213 filter->OnMessageReceived(VideoCaptureMsg_DeviceFormatsInUseReceived( |
214 delegate.device_id(), formats_in_use)); | 214 delegate.device_id(), formats_in_use)); |
215 } | 215 } |
216 } // namespace content | 216 } // namespace content |
OLD | NEW |