| 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 // Unit test for VideoCaptureManager. | 5 // Unit test for VideoCaptureManager. |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 const StreamDeviceInfoArray&)); | 39 const StreamDeviceInfoArray&)); |
| 40 MOCK_METHOD3(Error, void(MediaStreamType, int, | 40 MOCK_METHOD3(Error, void(MediaStreamType, int, |
| 41 MediaStreamProviderError)); | 41 MediaStreamProviderError)); |
| 42 }; // class MockMediaStreamProviderListener | 42 }; // class MockMediaStreamProviderListener |
| 43 | 43 |
| 44 // Needed as an input argument to Start(). | 44 // Needed as an input argument to Start(). |
| 45 class MockFrameObserver : public media::VideoCaptureDevice::EventHandler { | 45 class MockFrameObserver : public media::VideoCaptureDevice::EventHandler { |
| 46 public: | 46 public: |
| 47 virtual void OnError() OVERRIDE {} | 47 virtual void OnError() OVERRIDE {} |
| 48 void OnFrameInfo(const media::VideoCaptureCapability& info) {} | 48 void OnFrameInfo(const media::VideoCaptureCapability& info) {} |
| 49 virtual void OnIncomingCapturedFrame(const uint8* data, int length, | 49 virtual void OnIncomingCapturedFrame(const uint8* data, |
| 50 int length, |
| 50 base::Time timestamp) OVERRIDE {} | 51 base::Time timestamp) OVERRIDE {} |
| 52 virtual void OnIncomingCapturedVideoFrame(media::VideoFrame* frame, |
| 53 base::Time timestamp) OVERRIDE {} |
| 51 }; | 54 }; |
| 52 | 55 |
| 53 // Test class | 56 // Test class |
| 54 class VideoCaptureManagerTest : public testing::Test { | 57 class VideoCaptureManagerTest : public testing::Test { |
| 55 public: | 58 public: |
| 56 VideoCaptureManagerTest() {} | 59 VideoCaptureManagerTest() {} |
| 57 virtual ~VideoCaptureManagerTest() {} | 60 virtual ~VideoCaptureManagerTest() {} |
| 58 | 61 |
| 59 protected: | 62 protected: |
| 60 virtual void SetUp() OVERRIDE { | 63 virtual void SetUp() OVERRIDE { |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 // VideoCaptureManager destructor otherwise. | 256 // VideoCaptureManager destructor otherwise. |
| 254 vcm_->Close(video_session_id); | 257 vcm_->Close(video_session_id); |
| 255 vcm_->Stop(video_session_id, base::Closure()); | 258 vcm_->Stop(video_session_id, base::Closure()); |
| 256 | 259 |
| 257 // Wait to check callbacks before removing the listener | 260 // Wait to check callbacks before removing the listener |
| 258 message_loop_->RunUntilIdle(); | 261 message_loop_->RunUntilIdle(); |
| 259 vcm_->Unregister(); | 262 vcm_->Unregister(); |
| 260 } | 263 } |
| 261 | 264 |
| 262 } // namespace content | 265 } // namespace content |
| OLD | NEW |