MOCK_METHOD1(OnStateChanged, void(VideoCaptureState state));
MOCK_METHOD1(OnDeviceSupportedFormatsEnumerated,
void(const media::VideoCaptureFormats& formats));
+ MOCK_METHOD1(OnDeviceFormatsInUseReceived,
+ void(const media::VideoCaptureFormats& formats_in_use));
virtual void OnDelegateAdded(int32 device_id) OVERRIDE {
ASSERT_TRUE(device_id != 0);
VIDEO_CAPTURE_STATE_ENDED));
}
-TEST(VideoCaptureMessageFilterTest, GetSomeDeviceCapabilities) {
+TEST(VideoCaptureMessageFilterTest, GetSomeDeviceSupportedFormats) {
scoped_refptr<VideoCaptureMessageFilter> filter(
new VideoCaptureMessageFilter());
filter->AddDelegate(&delegate);
ASSERT_EQ(1, delegate.device_id());
- // VideoCaptureMsg_OnDeviceCapabilitiesEnumerated
EXPECT_CALL(delegate, OnDeviceSupportedFormatsEnumerated(_));
media::VideoCaptureFormats supported_formats;
filter->OnMessageReceived(VideoCaptureMsg_DeviceSupportedFormatsEnumerated(
delegate.device_id(), supported_formats));
}
+TEST(VideoCaptureMessageFilterTest, GetSomeDeviceFormatInUse) {
+ scoped_refptr<VideoCaptureMessageFilter> filter(
+ new VideoCaptureMessageFilter());
+
+ IPC::TestSink channel;
+ filter->OnFilterAdded(&channel);
+ MockVideoCaptureDelegate delegate;
+ filter->AddDelegate(&delegate);
+ ASSERT_EQ(1, delegate.device_id());
+
+ EXPECT_CALL(delegate, OnDeviceFormatsInUseReceived(_));
+ media::VideoCaptureFormats formats_in_use;
+ filter->OnMessageReceived(VideoCaptureMsg_DeviceFormatsInUseReceived(
+ delegate.device_id(), formats_in_use));
+}
} // namespace content