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

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

Issue 1875713002: New peerconnection test case, for video stream forwarding. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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 1952 matching lines...) Expand 10 before | Expand all | Expand 10 after
1963 kMaxWaitForFramesMs); 1963 kMaxWaitForFramesMs);
1964 // Now set the tracks, and expect frames to immediately start flowing. 1964 // Now set the tracks, and expect frames to immediately start flowing.
1965 EXPECT_TRUE( 1965 EXPECT_TRUE(
1966 audio_sender->SetTrack(initializing_client()->CreateLocalAudioTrack(""))); 1966 audio_sender->SetTrack(initializing_client()->CreateLocalAudioTrack("")));
1967 EXPECT_TRUE( 1967 EXPECT_TRUE(
1968 video_sender->SetTrack(initializing_client()->CreateLocalVideoTrack(""))); 1968 video_sender->SetTrack(initializing_client()->CreateLocalVideoTrack("")));
1969 EXPECT_TRUE_WAIT(FramesHaveArrived(kEndAudioFrameCount, kEndVideoFrameCount), 1969 EXPECT_TRUE_WAIT(FramesHaveArrived(kEndAudioFrameCount, kEndVideoFrameCount),
1970 kMaxWaitForFramesMs); 1970 kMaxWaitForFramesMs);
1971 } 1971 }
1972 1972
1973 TEST_F(P2PTestConductor, StreamForwardVideoOnly) {
1974 ASSERT_TRUE(CreateTestClients());
1975 // One-way stream
1976 receiving_client()->set_auto_add_stream(false);
1977 // Video only, audio forwarding not expected to work.
1978 initializing_client()->AddMediaStream(false, true);
1979 initializing_client()->Negotiate();
1980
1981 ASSERT_TRUE_WAIT(SessionActive(), kMaxWaitForActivationMs);
1982 VerifySessionDescriptions();
1983
1984 ASSERT_TRUE (initializing_client()->can_receive_video());
1985 ASSERT_TRUE (receiving_client()->can_receive_video());
1986
1987 EXPECT_EQ_WAIT(webrtc::PeerConnectionInterface::kIceConnectionCompleted,
1988 initializing_client()->ice_connection_state(),
1989 kMaxWaitForFramesMs);
1990 EXPECT_EQ_WAIT(webrtc::PeerConnectionInterface::kIceConnectionConnected,
1991 receiving_client()->ice_connection_state(),
1992 kMaxWaitForFramesMs);
1993
1994 ASSERT_TRUE(receiving_client()->remote_streams()->count() > 0);
1995 EXPECT_TRUE(receiving_client()->remote_streams()->count() == 1);
1996
1997 LOG(INFO) << "XXXXX Echoing stream XXXXX";
perkj_webrtc 2016/04/08 14:34:07 remove this log
nisse-webrtc 2016/04/11 06:35:39 Deleted locally, should be gone in next upload.
1998
1999 // Echo the stream back.
2000 receiving_client()->pc()->AddStream(
2001 receiving_client()->remote_streams()->at(0));
2002 receiving_client()->Negotiate();
2003
2004 EXPECT_TRUE_WAIT(
2005 initializing_client()->VideoFramesReceivedCheck(kEndVideoFrameCount),
2006 kMaxWaitForFramesMs);
2007 }
2008
1973 class IceServerParsingTest : public testing::Test { 2009 class IceServerParsingTest : public testing::Test {
1974 public: 2010 public:
1975 // Convenience for parsing a single URL. 2011 // Convenience for parsing a single URL.
1976 bool ParseUrl(const std::string& url) { 2012 bool ParseUrl(const std::string& url) {
1977 return ParseUrl(url, std::string(), std::string()); 2013 return ParseUrl(url, std::string(), std::string());
1978 } 2014 }
1979 2015
1980 bool ParseUrl(const std::string& url, 2016 bool ParseUrl(const std::string& url,
1981 const std::string& username, 2017 const std::string& username,
1982 const std::string& password) { 2018 const std::string& password) {
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
2155 server.urls.push_back("turn:hostname2"); 2191 server.urls.push_back("turn:hostname2");
2156 servers.push_back(server); 2192 servers.push_back(server);
2157 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_)); 2193 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_));
2158 EXPECT_EQ(2U, turn_servers_.size()); 2194 EXPECT_EQ(2U, turn_servers_.size());
2159 EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority); 2195 EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority);
2160 } 2196 }
2161 2197
2162 #endif // if !defined(THREAD_SANITIZER) 2198 #endif // if !defined(THREAD_SANITIZER)
2163 2199
2164 } // namespace 2200 } // namespace
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine2.h » ('j') | webrtc/media/engine/webrtcvideoengine2.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698