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

Side by Side Diff: webrtc/api/peerconnectionfactory_unittest.cc

Issue 1770003002: Renamed VideoSourceInterface to VideoTrackSourceInterface. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 16 matching lines...) Expand all
27 #include "webrtc/media/engine/webrtcvoe.h" 27 #include "webrtc/media/engine/webrtcvoe.h"
28 #include "webrtc/p2p/client/fakeportallocator.h" 28 #include "webrtc/p2p/client/fakeportallocator.h"
29 29
30 using webrtc::DataChannelInterface; 30 using webrtc::DataChannelInterface;
31 using webrtc::DtlsIdentityStoreInterface; 31 using webrtc::DtlsIdentityStoreInterface;
32 using webrtc::FakeVideoTrackRenderer; 32 using webrtc::FakeVideoTrackRenderer;
33 using webrtc::MediaStreamInterface; 33 using webrtc::MediaStreamInterface;
34 using webrtc::PeerConnectionFactoryInterface; 34 using webrtc::PeerConnectionFactoryInterface;
35 using webrtc::PeerConnectionInterface; 35 using webrtc::PeerConnectionInterface;
36 using webrtc::PeerConnectionObserver; 36 using webrtc::PeerConnectionObserver;
37 using webrtc::VideoSourceInterface; 37 using webrtc::VideoTrackSourceInterface;
38 using webrtc::VideoTrackInterface; 38 using webrtc::VideoTrackInterface;
39 39
40 namespace { 40 namespace {
41 41
42 static const char kStunIceServer[] = "stun:stun.l.google.com:19302"; 42 static const char kStunIceServer[] = "stun:stun.l.google.com:19302";
43 static const char kTurnIceServer[] = "turn:test%40hello.com@test.com:1234"; 43 static const char kTurnIceServer[] = "turn:test%40hello.com@test.com:1234";
44 static const char kTurnIceServerWithTransport[] = 44 static const char kTurnIceServerWithTransport[] =
45 "turn:test@hello.com?transport=tcp"; 45 "turn:test@hello.com?transport=tcp";
46 static const char kSecureTurnIceServer[] = 46 static const char kSecureTurnIceServer[] =
47 "turns:test@hello.com?transport=tcp"; 47 "turns:test@hello.com?transport=tcp";
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 cricket::PROTO_UDP, false); 325 cricket::PROTO_UDP, false);
326 turn_servers.push_back(turn1); 326 turn_servers.push_back(turn1);
327 VerifyTurnServers(turn_servers); 327 VerifyTurnServers(turn_servers);
328 } 328 }
329 329
330 // This test verifies the captured stream is rendered locally using a 330 // This test verifies the captured stream is rendered locally using a
331 // local video track. 331 // local video track.
332 TEST_F(PeerConnectionFactoryTest, LocalRendering) { 332 TEST_F(PeerConnectionFactoryTest, LocalRendering) {
333 cricket::FakeVideoCapturer* capturer = new cricket::FakeVideoCapturer(); 333 cricket::FakeVideoCapturer* capturer = new cricket::FakeVideoCapturer();
334 // The source take ownership of |capturer|. 334 // The source take ownership of |capturer|.
335 rtc::scoped_refptr<VideoSourceInterface> source( 335 rtc::scoped_refptr<VideoTrackSourceInterface> source(
336 factory_->CreateVideoSource(capturer, NULL)); 336 factory_->CreateVideoSource(capturer, NULL));
337 ASSERT_TRUE(source.get() != NULL); 337 ASSERT_TRUE(source.get() != NULL);
338 rtc::scoped_refptr<VideoTrackInterface> track( 338 rtc::scoped_refptr<VideoTrackInterface> track(
339 factory_->CreateVideoTrack("testlabel", source)); 339 factory_->CreateVideoTrack("testlabel", source));
340 ASSERT_TRUE(track.get() != NULL); 340 ASSERT_TRUE(track.get() != NULL);
341 FakeVideoTrackRenderer local_renderer(track); 341 FakeVideoTrackRenderer local_renderer(track);
342 342
343 EXPECT_EQ(0, local_renderer.num_rendered_frames()); 343 EXPECT_EQ(0, local_renderer.num_rendered_frames());
344 EXPECT_TRUE(capturer->CaptureFrame()); 344 EXPECT_TRUE(capturer->CaptureFrame());
345 EXPECT_EQ(1, local_renderer.num_rendered_frames()); 345 EXPECT_EQ(1, local_renderer.num_rendered_frames());
346 EXPECT_FALSE(local_renderer.black_frame()); 346 EXPECT_FALSE(local_renderer.black_frame());
347 347
348 track->set_enabled(false); 348 track->set_enabled(false);
349 EXPECT_TRUE(capturer->CaptureFrame()); 349 EXPECT_TRUE(capturer->CaptureFrame());
350 EXPECT_EQ(2, local_renderer.num_rendered_frames()); 350 EXPECT_EQ(2, local_renderer.num_rendered_frames());
351 EXPECT_TRUE(local_renderer.black_frame()); 351 EXPECT_TRUE(local_renderer.black_frame());
352 352
353 track->set_enabled(true); 353 track->set_enabled(true);
354 EXPECT_TRUE(capturer->CaptureFrame()); 354 EXPECT_TRUE(capturer->CaptureFrame());
355 EXPECT_EQ(3, local_renderer.num_rendered_frames()); 355 EXPECT_EQ(3, local_renderer.num_rendered_frames());
356 EXPECT_FALSE(local_renderer.black_frame()); 356 EXPECT_FALSE(local_renderer.black_frame());
357 } 357 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698