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/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "content/child/child_process.h" | 6 #include "content/child/child_process.h" |
7 #include "content/common/media/video_capture_messages.h" | 7 #include "content/common/media/video_capture_messages.h" |
8 #include "content/renderer/media/video_capture_impl.h" | 8 #include "content/renderer/media/video_capture_impl.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 public: | 33 public: |
34 MockVideoCaptureClient() {} | 34 MockVideoCaptureClient() {} |
35 virtual ~MockVideoCaptureClient() {} | 35 virtual ~MockVideoCaptureClient() {} |
36 | 36 |
37 // EventHandler implementation. | 37 // EventHandler implementation. |
38 MOCK_METHOD1(OnStarted, void(media::VideoCapture* capture)); | 38 MOCK_METHOD1(OnStarted, void(media::VideoCapture* capture)); |
39 MOCK_METHOD1(OnStopped, void(media::VideoCapture* capture)); | 39 MOCK_METHOD1(OnStopped, void(media::VideoCapture* capture)); |
40 MOCK_METHOD1(OnPaused, void(media::VideoCapture* capture)); | 40 MOCK_METHOD1(OnPaused, void(media::VideoCapture* capture)); |
41 MOCK_METHOD2(OnError, void(media::VideoCapture* capture, int error_code)); | 41 MOCK_METHOD2(OnError, void(media::VideoCapture* capture, int error_code)); |
42 MOCK_METHOD1(OnRemoved, void(media::VideoCapture* capture)); | 42 MOCK_METHOD1(OnRemoved, void(media::VideoCapture* capture)); |
43 MOCK_METHOD2(OnBufferReady, | 43 MOCK_METHOD2(OnFrameReady, |
44 void(media::VideoCapture* capture, | 44 void(media::VideoCapture* capture, |
45 scoped_refptr<media::VideoCapture::VideoFrameBuffer> buf)); | 45 const scoped_refptr<media::VideoFrame>& frame)); |
46 MOCK_METHOD2(OnDeviceInfoReceived, | 46 MOCK_METHOD2(OnDeviceInfoReceived, |
47 void(media::VideoCapture* capture, | 47 void(media::VideoCapture* capture, |
48 const media::VideoCaptureParams& device_info)); | 48 const media::VideoCaptureParams& device_info)); |
49 | 49 |
50 private: | 50 private: |
51 DISALLOW_COPY_AND_ASSIGN(MockVideoCaptureClient); | 51 DISALLOW_COPY_AND_ASSIGN(MockVideoCaptureClient); |
52 }; | 52 }; |
53 | 53 |
54 class VideoCaptureImplTest : public ::testing::Test { | 54 class VideoCaptureImplTest : public ::testing::Test { |
55 public: | 55 public: |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 .WillOnce(Return()); | 294 .WillOnce(Return()); |
295 EXPECT_CALL(*client2, OnRemoved(_)) | 295 EXPECT_CALL(*client2, OnRemoved(_)) |
296 .WillOnce(Return()); | 296 .WillOnce(Return()); |
297 | 297 |
298 video_capture_impl_->StopCapture(client1.get()); | 298 video_capture_impl_->StopCapture(client1.get()); |
299 video_capture_impl_->StopCapture(client2.get()); | 299 video_capture_impl_->StopCapture(client2.get()); |
300 message_loop_->RunUntilIdle(); | 300 message_loop_->RunUntilIdle(); |
301 } | 301 } |
302 | 302 |
303 } // namespace content | 303 } // namespace content |
OLD | NEW |