| 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 #include <list> | 5 #include <list> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 | 315 |
| 316 void ReturnReceivedPackets() { | 316 void ReturnReceivedPackets() { |
| 317 host_->ReturnReceivedDibs(kDeviceId); | 317 host_->ReturnReceivedDibs(kDeviceId); |
| 318 } | 318 } |
| 319 | 319 |
| 320 void SimulateError() { | 320 void SimulateError() { |
| 321 // Expect a change state to error state sent through IPC. | 321 // Expect a change state to error state sent through IPC. |
| 322 EXPECT_CALL(*host_, OnStateChanged(kRouteId, kDeviceId, | 322 EXPECT_CALL(*host_, OnStateChanged(kRouteId, kDeviceId, |
| 323 media::VideoCapture::kError)) | 323 media::VideoCapture::kError)) |
| 324 .Times(1); | 324 .Times(1); |
| 325 VideoCaptureController::ControllerId id(kRouteId, kDeviceId); | 325 VideoCaptureControllerID id(kRouteId, kDeviceId); |
| 326 host_->OnError(id); | 326 host_->OnError(id); |
| 327 SyncWithVideoCaptureManagerThread(); | 327 SyncWithVideoCaptureManagerThread(); |
| 328 } | 328 } |
| 329 | 329 |
| 330 scoped_refptr<MockVideoCaptureHost> host_; | 330 scoped_refptr<MockVideoCaptureHost> host_; |
| 331 private: | 331 private: |
| 332 scoped_ptr<MessageLoop> message_loop_; | 332 scoped_ptr<MessageLoop> message_loop_; |
| 333 scoped_ptr<BrowserThread> io_thread_; | 333 scoped_ptr<BrowserThread> io_thread_; |
| 334 | 334 |
| 335 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHostTest); | 335 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHostTest); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 364 } | 364 } |
| 365 | 365 |
| 366 #ifdef DUMP_VIDEO | 366 #ifdef DUMP_VIDEO |
| 367 TEST_F(VideoCaptureHostTest, CaptureAndDumpVideoVga) { | 367 TEST_F(VideoCaptureHostTest, CaptureAndDumpVideoVga) { |
| 368 CaptureAndDumpVideo(640, 480, 30); | 368 CaptureAndDumpVideo(640, 480, 30); |
| 369 } | 369 } |
| 370 TEST_F(VideoCaptureHostTest, CaptureAndDump720P) { | 370 TEST_F(VideoCaptureHostTest, CaptureAndDump720P) { |
| 371 CaptureAndDumpVideo(1280, 720, 30); | 371 CaptureAndDumpVideo(1280, 720, 30); |
| 372 } | 372 } |
| 373 #endif | 373 #endif |
| OLD | NEW |