| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 }; // class MockMediaStreamProviderListener | 58 }; // class MockMediaStreamProviderListener |
| 59 | 59 |
| 60 } // namespace media_stream | 60 } // namespace media_stream |
| 61 | 61 |
| 62 namespace { | 62 namespace { |
| 63 | 63 |
| 64 // Needed as an input argument to Start(). | 64 // Needed as an input argument to Start(). |
| 65 class MockFrameObserver: public media::VideoCaptureDevice::EventHandler { | 65 class MockFrameObserver: public media::VideoCaptureDevice::EventHandler { |
| 66 public: | 66 public: |
| 67 virtual void OnError() {} | 67 virtual void OnError() {} |
| 68 void OnFrameInfo(const media::VideoCaptureDevice::Capability& info) {} | 68 void OnFrameInfo(const media::VideoCaptureCapability& info) {} |
| 69 virtual void OnIncomingCapturedFrame(const uint8* data, int length, | 69 virtual void OnIncomingCapturedFrame(const uint8* data, int length, |
| 70 base::Time timestamp) {} | 70 base::Time timestamp) {} |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 // Test class | 73 // Test class |
| 74 class VideoCaptureManagerTest : public testing::Test { | 74 class VideoCaptureManagerTest : public testing::Test { |
| 75 public: | 75 public: |
| 76 VideoCaptureManagerTest() | 76 VideoCaptureManagerTest() |
| 77 : vcm_(), | 77 : vcm_(), |
| 78 listener_(), | 78 listener_(), |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 // VideoCaptureManager destructor otherwise. | 320 // VideoCaptureManager destructor otherwise. |
| 321 vcm_->Close(video_session_id); | 321 vcm_->Close(video_session_id); |
| 322 vcm_->Stop(video_session_id, base::Closure()); | 322 vcm_->Stop(video_session_id, base::Closure()); |
| 323 | 323 |
| 324 // Wait to check callbacks before removing the listener | 324 // Wait to check callbacks before removing the listener |
| 325 SyncWithVideoCaptureManagerThread(); | 325 SyncWithVideoCaptureManagerThread(); |
| 326 vcm_->Unregister(); | 326 vcm_->Unregister(); |
| 327 } | 327 } |
| 328 | 328 |
| 329 } // namespace | 329 } // namespace |
| OLD | NEW |