| 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/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "base/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
| 8 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "media/video/capture/fake_video_capture_device.h" | 10 #include "media/video/capture/fake_video_capture_device.h" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 } | 268 } |
| 269 | 269 |
| 270 TEST_F(VideoCaptureDeviceTest, TestFakeCapture) { | 270 TEST_F(VideoCaptureDeviceTest, TestFakeCapture) { |
| 271 VideoCaptureDevice::Names names; | 271 VideoCaptureDevice::Names names; |
| 272 | 272 |
| 273 FakeVideoCaptureDevice::GetDeviceNames(&names); | 273 FakeVideoCaptureDevice::GetDeviceNames(&names); |
| 274 | 274 |
| 275 ASSERT_GT(static_cast<int>(names.size()), 0); | 275 ASSERT_GT(static_cast<int>(names.size()), 0); |
| 276 | 276 |
| 277 scoped_ptr<VideoCaptureDevice> device( | 277 scoped_ptr<VideoCaptureDevice> device( |
| 278 FakeVideoCaptureDevice::Create(names.front())); | 278 FakeVideoCaptureDevice::Create(names.front(), false)); |
| 279 ASSERT_TRUE(device.get() != NULL); | 279 ASSERT_TRUE(device.get() != NULL); |
| 280 | 280 |
| 281 // Get info about the new resolution. | 281 // Get info about the new resolution. |
| 282 EXPECT_CALL(*frame_observer_, OnFrameInfo(640, 480, 30, _)) | 282 EXPECT_CALL(*frame_observer_, OnFrameInfo(640, 480, 30, _)) |
| 283 .Times(1); | 283 .Times(1); |
| 284 | 284 |
| 285 EXPECT_CALL(*frame_observer_, OnErr()) | 285 EXPECT_CALL(*frame_observer_, OnErr()) |
| 286 .Times(0); | 286 .Times(0); |
| 287 | 287 |
| 288 device->Allocate(640, 480, 30, frame_observer_.get()); | 288 device->Allocate(640, 480, 30, frame_observer_.get()); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 314 device->Allocate(1280, 720, 30, frame_observer_.get()); | 314 device->Allocate(1280, 720, 30, frame_observer_.get()); |
| 315 | 315 |
| 316 device->Start(); | 316 device->Start(); |
| 317 // Get captured video frames. | 317 // Get captured video frames. |
| 318 PostQuitTask(); | 318 PostQuitTask(); |
| 319 EXPECT_TRUE(wait_event_.TimedWait(TestTimeouts::action_max_timeout())); | 319 EXPECT_TRUE(wait_event_.TimedWait(TestTimeouts::action_max_timeout())); |
| 320 device->DeAllocate(); | 320 device->DeAllocate(); |
| 321 } | 321 } |
| 322 | 322 |
| 323 }; // namespace media | 323 }; // namespace media |
| OLD | NEW |