Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: content/browser/renderer_host/media/video_capture_host_unittest.cc

Issue 8304017: enable video capture to support sharing across multiple renderer processes (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 message_loop_->PostTask( 262 message_loop_->PostTask(
263 FROM_HERE, 263 FROM_HERE,
264 base::Bind(&PostQuitOnVideoCaptureManagerThread, 264 base::Bind(&PostQuitOnVideoCaptureManagerThread,
265 message_loop_.get(), 265 message_loop_.get(),
266 content::MockResourceContext::GetInstance())); 266 content::MockResourceContext::GetInstance()));
267 message_loop_->Run(); 267 message_loop_->Run();
268 } 268 }
269 269
270 void StartCapture() { 270 void StartCapture() {
271 InSequence s; 271 InSequence s;
272 // 1. Newly created buffers will arrive. 272 // 1. First - get info about the new resolution
273 EXPECT_CALL(*host_, OnDeviceInfo(kDeviceId));
274
275 // 2. Change state to started
276 EXPECT_CALL(*host_, OnStateChanged(kDeviceId,
277 media::VideoCapture::kStarted));
278
279 // 3. Newly created buffers will arrive.
273 EXPECT_CALL(*host_, OnNewBufferCreated(kDeviceId, _, _, _)) 280 EXPECT_CALL(*host_, OnNewBufferCreated(kDeviceId, _, _, _))
274 .Times(AnyNumber()) 281 .Times(AnyNumber())
275 .WillRepeatedly(Return()); 282 .WillRepeatedly(Return());
276 283
277 // 2. First - get info about the new resolution
278 EXPECT_CALL(*host_, OnDeviceInfo(kDeviceId));
279
280 // 3. Change state to started
281 EXPECT_CALL(*host_, OnStateChanged(kDeviceId,
282 media::VideoCapture::kStarted));
283
284 // 4. First filled buffer will arrive. 284 // 4. First filled buffer will arrive.
285 EXPECT_CALL(*host_, OnBufferFilled(kDeviceId, _, _)) 285 EXPECT_CALL(*host_, OnBufferFilled(kDeviceId, _, _))
286 .Times(AnyNumber()) 286 .Times(AnyNumber())
287 .WillOnce(ExitMessageLoop(message_loop_.get())); 287 .WillOnce(ExitMessageLoop(message_loop_.get()));
288 288
289 media::VideoCaptureParams params; 289 media::VideoCaptureParams params;
290 params.width = 352; 290 params.width = 352;
291 params.height = 288; 291 params.height = 288;
292 params.frame_per_second = 30; 292 params.frame_per_second = 30;
293 params.session_id = kTestFakeDeviceId; 293 params.session_id = kTestFakeDeviceId;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 } 396 }
397 397
398 #ifdef DUMP_VIDEO 398 #ifdef DUMP_VIDEO
399 TEST_F(VideoCaptureHostTest, CaptureAndDumpVideoVga) { 399 TEST_F(VideoCaptureHostTest, CaptureAndDumpVideoVga) {
400 CaptureAndDumpVideo(640, 480, 30); 400 CaptureAndDumpVideo(640, 480, 30);
401 } 401 }
402 TEST_F(VideoCaptureHostTest, CaptureAndDump720P) { 402 TEST_F(VideoCaptureHostTest, CaptureAndDump720P) {
403 CaptureAndDumpVideo(1280, 720, 30); 403 CaptureAndDumpVideo(1280, 720, 30);
404 } 404 }
405 #endif 405 #endif
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/video_capture_host.cc ('k') | content/browser/renderer_host/media/video_capture_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698