OLD | NEW |
---|---|
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 1963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1974 kMaxWaitForFramesMs); | 1974 kMaxWaitForFramesMs); |
1975 // Now set the tracks, and expect frames to immediately start flowing. | 1975 // Now set the tracks, and expect frames to immediately start flowing. |
1976 EXPECT_TRUE( | 1976 EXPECT_TRUE( |
1977 audio_sender->SetTrack(initializing_client()->CreateLocalAudioTrack(""))); | 1977 audio_sender->SetTrack(initializing_client()->CreateLocalAudioTrack(""))); |
1978 EXPECT_TRUE( | 1978 EXPECT_TRUE( |
1979 video_sender->SetTrack(initializing_client()->CreateLocalVideoTrack(""))); | 1979 video_sender->SetTrack(initializing_client()->CreateLocalVideoTrack(""))); |
1980 EXPECT_TRUE_WAIT(FramesHaveArrived(kEndAudioFrameCount, kEndVideoFrameCount), | 1980 EXPECT_TRUE_WAIT(FramesHaveArrived(kEndAudioFrameCount, kEndVideoFrameCount), |
1981 kMaxWaitForFramesMs); | 1981 kMaxWaitForFramesMs); |
1982 } | 1982 } |
1983 | 1983 |
1984 TEST_F(P2PTestConductor, StreamForwardVideoOnly) { | |
perkj_webrtc
2016/04/21 08:18:28
Name ForwardVideoOnlyStream?
nisse-webrtc
2016/04/22 11:13:09
Done.
| |
1985 ASSERT_TRUE(CreateTestClients()); | |
1986 // One-way stream | |
1987 receiving_client()->set_auto_add_stream(false); | |
1988 // Video only, audio forwarding not expected to work. | |
1989 initializing_client()->AddMediaStream(false, true); | |
1990 initializing_client()->Negotiate(); | |
1991 | |
1992 ASSERT_TRUE_WAIT(SessionActive(), kMaxWaitForActivationMs); | |
1993 VerifySessionDescriptions(); | |
1994 | |
1995 ASSERT_TRUE (initializing_client()->can_receive_video()); | |
pbos-webrtc
2016/04/21 13:03:23
git cl format please
nisse-webrtc
2016/04/22 11:13:08
Done.
| |
1996 ASSERT_TRUE (receiving_client()->can_receive_video()); | |
1997 | |
1998 EXPECT_EQ_WAIT(webrtc::PeerConnectionInterface::kIceConnectionCompleted, | |
1999 initializing_client()->ice_connection_state(), | |
2000 kMaxWaitForFramesMs); | |
2001 EXPECT_EQ_WAIT(webrtc::PeerConnectionInterface::kIceConnectionConnected, | |
2002 receiving_client()->ice_connection_state(), | |
2003 kMaxWaitForFramesMs); | |
2004 | |
2005 ASSERT_TRUE(receiving_client()->remote_streams()->count() > 0); | |
2006 EXPECT_TRUE(receiving_client()->remote_streams()->count() == 1); | |
perkj_webrtc
2016/04/21 08:18:28
nit: ASSERT_TRUE == 1 only.
nisse-webrtc
2016/04/22 11:13:08
Done.
| |
2007 | |
2008 // Echo the stream back. | |
2009 receiving_client()->pc()->AddStream( | |
2010 receiving_client()->remote_streams()->at(0)); | |
2011 receiving_client()->Negotiate(); | |
2012 | |
2013 EXPECT_TRUE_WAIT( | |
2014 initializing_client()->VideoFramesReceivedCheck(kEndVideoFrameCount), | |
2015 kMaxWaitForFramesMs); | |
2016 } | |
2017 | |
1984 class IceServerParsingTest : public testing::Test { | 2018 class IceServerParsingTest : public testing::Test { |
1985 public: | 2019 public: |
1986 // Convenience for parsing a single URL. | 2020 // Convenience for parsing a single URL. |
1987 bool ParseUrl(const std::string& url) { | 2021 bool ParseUrl(const std::string& url) { |
1988 return ParseUrl(url, std::string(), std::string()); | 2022 return ParseUrl(url, std::string(), std::string()); |
1989 } | 2023 } |
1990 | 2024 |
1991 bool ParseUrl(const std::string& url, | 2025 bool ParseUrl(const std::string& url, |
1992 const std::string& username, | 2026 const std::string& username, |
1993 const std::string& password) { | 2027 const std::string& password) { |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2166 server.urls.push_back("turn:hostname2"); | 2200 server.urls.push_back("turn:hostname2"); |
2167 servers.push_back(server); | 2201 servers.push_back(server); |
2168 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_)); | 2202 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_)); |
2169 EXPECT_EQ(2U, turn_servers_.size()); | 2203 EXPECT_EQ(2U, turn_servers_.size()); |
2170 EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority); | 2204 EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority); |
2171 } | 2205 } |
2172 | 2206 |
2173 #endif // if !defined(THREAD_SANITIZER) | 2207 #endif // if !defined(THREAD_SANITIZER) |
2174 | 2208 |
2175 } // namespace | 2209 } // namespace |
OLD | NEW |