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

Side by Side Diff: talk/app/webrtc/videosource_unittest.cc

Issue 1660103003: Delete FrameInput method and FrameInputWrapper class. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Comment improvement. Created 4 years, 10 months 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
« no previous file with comments | « talk/app/webrtc/videosource.cc ('k') | talk/app/webrtc/videosourceinterface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 ASSERT_TRUE(source_.get() != NULL); 215 ASSERT_TRUE(source_.get() != NULL);
216 EXPECT_TRUE(NULL != source_->GetVideoCapturer()); 216 EXPECT_TRUE(NULL != source_->GetVideoCapturer());
217 217
218 state_observer_.reset(new StateObserver(source_)); 218 state_observer_.reset(new StateObserver(source_));
219 source_->RegisterObserver(state_observer_.get()); 219 source_->RegisterObserver(state_observer_.get());
220 source_->AddSink(&renderer_); 220 source_->AddSink(&renderer_);
221 221
222 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), 222 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(),
223 kMaxWaitMs); 223 kMaxWaitMs);
224 224
225 cricket::VideoRenderer* frameinput = source_->FrameInput();
226 cricket::WebRtcVideoFrame test_frame;
227 frameinput->RenderFrame(&test_frame);
228 EXPECT_EQ(1, renderer_.num_rendered_frames());
229
230 source_->GetVideoCapturer()->Stop(); 225 source_->GetVideoCapturer()->Stop();
231 EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(), 226 EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(),
232 kMaxWaitMs); 227 kMaxWaitMs);
233 } 228 }
234 229
235 // Test that a VideoSource transition to kEnded if the capture device 230 // Test that a VideoSource transition to kEnded if the capture device
236 // fails. 231 // fails.
237 TEST_F(VideoSourceTest, CameraFailed) { 232 TEST_F(VideoSourceTest, CameraFailed) {
238 CreateVideoSource(); 233 CreateVideoSource();
239 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), 234 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(),
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 FakeConstraints constraints; 537 FakeConstraints constraints;
543 constraints.AddOptional(MediaConstraintsInterface::kMaxFrameRate, 0.5); 538 constraints.AddOptional(MediaConstraintsInterface::kMaxFrameRate, 0.5);
544 539
545 CreateVideoSource(&constraints); 540 CreateVideoSource(&constraints);
546 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), 541 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(),
547 kMaxWaitMs); 542 kMaxWaitMs);
548 const cricket::VideoFormat* format = capturer_->GetCaptureFormat(); 543 const cricket::VideoFormat* format = capturer_->GetCaptureFormat();
549 ASSERT_TRUE(format != NULL); 544 ASSERT_TRUE(format != NULL);
550 EXPECT_EQ(30, format->framerate()); 545 EXPECT_EQ(30, format->framerate());
551 } 546 }
OLDNEW
« no previous file with comments | « talk/app/webrtc/videosource.cc ('k') | talk/app/webrtc/videosourceinterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698