OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 | 57 |
58 namespace { | 58 namespace { |
59 | 59 |
60 // Needed as an input argument to Start() | 60 // Needed as an input argument to Start() |
61 class MockFrameObserver: public media::VideoCaptureDevice::EventHandler { | 61 class MockFrameObserver: public media::VideoCaptureDevice::EventHandler { |
62 public: | 62 public: |
63 virtual void OnError() {} | 63 virtual void OnError() {} |
64 void OnFrameInfo(const media::VideoCaptureDevice::Capability& info) {} | 64 void OnFrameInfo(const media::VideoCaptureDevice::Capability& info) {} |
65 virtual void OnIncomingCapturedFrame(const uint8* data, int length, | 65 virtual void OnIncomingCapturedFrame(const uint8* data, int length, |
66 base::Time timestamp) {} | 66 base::Time timestamp) {} |
67 virtual void OnDeviceState(bool in_use) {} | |
perkj_chrome
2011/10/28 08:37:19
remove
wjia(left Chromium)
2011/10/29 02:34:40
Done.
| |
67 }; | 68 }; |
68 | 69 |
69 // Test class | 70 // Test class |
70 class VideoCaptureManagerTest : public testing::Test { | 71 class VideoCaptureManagerTest : public testing::Test { |
71 public: | 72 public: |
72 VideoCaptureManagerTest() | 73 VideoCaptureManagerTest() |
73 : vcm_(), | 74 : vcm_(), |
74 listener_(), | 75 listener_(), |
75 message_loop_(), | 76 message_loop_(), |
76 io_thread_(), | 77 io_thread_(), |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
298 vcm_->Open(*it); | 299 vcm_->Open(*it); |
299 | 300 |
300 // Wait to check callbacks before removing the listener | 301 // Wait to check callbacks before removing the listener |
301 SyncWithVideoCaptureManagerThread(); | 302 SyncWithVideoCaptureManagerThread(); |
302 | 303 |
303 // Delete the manager. | 304 // Delete the manager. |
304 vcm_.reset(); | 305 vcm_.reset(); |
305 } | 306 } |
306 | 307 |
307 } // namespace | 308 } // namespace |
OLD | NEW |