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, ForwardVideoOnlyStream) { |
| 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()); |
| 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() == 1); |
| 2006 |
| 2007 // Echo the stream back. |
| 2008 receiving_client()->pc()->AddStream( |
| 2009 receiving_client()->remote_streams()->at(0)); |
| 2010 receiving_client()->Negotiate(); |
| 2011 |
| 2012 EXPECT_TRUE_WAIT( |
| 2013 initializing_client()->VideoFramesReceivedCheck(kEndVideoFrameCount), |
| 2014 kMaxWaitForFramesMs); |
| 2015 } |
| 2016 |
1984 class IceServerParsingTest : public testing::Test { | 2017 class IceServerParsingTest : public testing::Test { |
1985 public: | 2018 public: |
1986 // Convenience for parsing a single URL. | 2019 // Convenience for parsing a single URL. |
1987 bool ParseUrl(const std::string& url) { | 2020 bool ParseUrl(const std::string& url) { |
1988 return ParseUrl(url, std::string(), std::string()); | 2021 return ParseUrl(url, std::string(), std::string()); |
1989 } | 2022 } |
1990 | 2023 |
1991 bool ParseUrl(const std::string& url, | 2024 bool ParseUrl(const std::string& url, |
1992 const std::string& username, | 2025 const std::string& username, |
1993 const std::string& password) { | 2026 const std::string& password) { |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2166 server.urls.push_back("turn:hostname2"); | 2199 server.urls.push_back("turn:hostname2"); |
2167 servers.push_back(server); | 2200 servers.push_back(server); |
2168 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_)); | 2201 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_)); |
2169 EXPECT_EQ(2U, turn_servers_.size()); | 2202 EXPECT_EQ(2U, turn_servers_.size()); |
2170 EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority); | 2203 EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority); |
2171 } | 2204 } |
2172 | 2205 |
2173 #endif // if !defined(THREAD_SANITIZER) | 2206 #endif // if !defined(THREAD_SANITIZER) |
2174 | 2207 |
2175 } // namespace | 2208 } // namespace |
OLD | NEW |