Chromium Code Reviews| 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 29 matching lines...) Expand all Loading... | |
| 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, int length, |
| 50 base::Time timestamp) OVERRIDE {} | 50 base::Time timestamp) OVERRIDE {} |
|
wjia(left Chromium)
2013/02/04 23:48:40
For function declarations and definitions, put eac
ncarter (slow)
2013/02/05 17:36:08
Done.
| |
| 51 virtual void OnIncomingCapturedVideoFrame(media::VideoFrame* frame, | |
| 52 base::Time timestamp) OVERRIDE {} | |
| 51 }; | 53 }; |
| 52 | 54 |
| 53 // Test class | 55 // Test class |
| 54 class VideoCaptureManagerTest : public testing::Test { | 56 class VideoCaptureManagerTest : public testing::Test { |
| 55 public: | 57 public: |
| 56 VideoCaptureManagerTest() {} | 58 VideoCaptureManagerTest() {} |
| 57 virtual ~VideoCaptureManagerTest() {} | 59 virtual ~VideoCaptureManagerTest() {} |
| 58 | 60 |
| 59 protected: | 61 protected: |
| 60 virtual void SetUp() OVERRIDE { | 62 virtual void SetUp() OVERRIDE { |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 253 // VideoCaptureManager destructor otherwise. | 255 // VideoCaptureManager destructor otherwise. |
| 254 vcm_->Close(video_session_id); | 256 vcm_->Close(video_session_id); |
| 255 vcm_->Stop(video_session_id, base::Closure()); | 257 vcm_->Stop(video_session_id, base::Closure()); |
| 256 | 258 |
| 257 // Wait to check callbacks before removing the listener | 259 // Wait to check callbacks before removing the listener |
| 258 message_loop_->RunUntilIdle(); | 260 message_loop_->RunUntilIdle(); |
| 259 vcm_->Unregister(); | 261 vcm_->Unregister(); |
| 260 } | 262 } |
| 261 | 263 |
| 262 } // namespace content | 264 } // namespace content |
| OLD | NEW |