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 <map> | 5 #include <map> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 | 245 |
246 // 4. First filled buffer will arrive. | 246 // 4. First filled buffer will arrive. |
247 base::RunLoop run_loop; | 247 base::RunLoop run_loop; |
248 EXPECT_CALL(*host_.get(), OnBufferFilled(kDeviceId, _, _)) | 248 EXPECT_CALL(*host_.get(), OnBufferFilled(kDeviceId, _, _)) |
249 .Times(AnyNumber()).WillOnce(ExitMessageLoop( | 249 .Times(AnyNumber()).WillOnce(ExitMessageLoop( |
250 message_loop_, run_loop.QuitClosure())); | 250 message_loop_, run_loop.QuitClosure())); |
251 | 251 |
252 media::VideoCaptureParams params; | 252 media::VideoCaptureParams params; |
253 params.width = 352; | 253 params.width = 352; |
254 params.height = 288; | 254 params.height = 288; |
255 params.frame_per_second = 30; | 255 params.frame_rate = 30; |
256 params.session_id = kTestFakeDeviceId; | 256 params.session_id = kTestFakeDeviceId; |
257 host_->OnStartCapture(kDeviceId, params); | 257 host_->OnStartCapture(kDeviceId, params); |
258 run_loop.Run(); | 258 run_loop.Run(); |
259 } | 259 } |
260 | 260 |
261 #ifdef DUMP_VIDEO | 261 #ifdef DUMP_VIDEO |
262 void CaptureAndDumpVideo(int width, int heigt, int frame_rate) { | 262 void CaptureAndDumpVideo(int width, int heigt, int frame_rate) { |
263 InSequence s; | 263 InSequence s; |
264 // 1. First - get info about the new resolution | 264 // 1. First - get info about the new resolution |
265 EXPECT_CALL(*host_, OnDeviceInfo(kDeviceId)); | 265 EXPECT_CALL(*host_, OnDeviceInfo(kDeviceId)); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 #ifdef DUMP_VIDEO | 365 #ifdef DUMP_VIDEO |
366 TEST_F(VideoCaptureHostTest, CaptureAndDumpVideoVga) { | 366 TEST_F(VideoCaptureHostTest, CaptureAndDumpVideoVga) { |
367 CaptureAndDumpVideo(640, 480, 30); | 367 CaptureAndDumpVideo(640, 480, 30); |
368 } | 368 } |
369 TEST_F(VideoCaptureHostTest, CaptureAndDump720P) { | 369 TEST_F(VideoCaptureHostTest, CaptureAndDump720P) { |
370 CaptureAndDumpVideo(1280, 720, 30); | 370 CaptureAndDumpVideo(1280, 720, 30); |
371 } | 371 } |
372 #endif | 372 #endif |
373 | 373 |
374 } // namespace content | 374 } // namespace content |
OLD | NEW |