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 2279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2290 // Ensure data can be sent in both directions. | 2290 // Ensure data can be sent in both directions. |
2291 std::string data = "hello world"; | 2291 std::string data = "hello world"; |
2292 caller()->data_channel()->Send(DataBuffer(data)); | 2292 caller()->data_channel()->Send(DataBuffer(data)); |
2293 EXPECT_EQ_WAIT(data, callee()->data_observer()->last_message(), | 2293 EXPECT_EQ_WAIT(data, callee()->data_observer()->last_message(), |
2294 kDefaultTimeout); | 2294 kDefaultTimeout); |
2295 callee()->data_channel()->Send(DataBuffer(data)); | 2295 callee()->data_channel()->Send(DataBuffer(data)); |
2296 EXPECT_EQ_WAIT(data, caller()->data_observer()->last_message(), | 2296 EXPECT_EQ_WAIT(data, caller()->data_observer()->last_message(), |
2297 kDefaultTimeout); | 2297 kDefaultTimeout); |
2298 } | 2298 } |
2299 | 2299 |
| 2300 // This test sets up a call between two parties with an SCTP data channel only. |
| 2301 TEST_F(PeerConnectionIntegrationTest, EndToEndCallWithSctpDataChannelOnly) { |
| 2302 ASSERT_TRUE(CreatePeerConnectionWrappers()); |
| 2303 ConnectFakeSignaling(); |
| 2304 // Expect that data channel created on caller side will show up for callee as |
| 2305 // well. |
| 2306 caller()->CreateDataChannel(); |
| 2307 PeerConnectionInterface::RTCOfferAnswerOptions options; |
| 2308 options.offer_to_receive_audio = 0; |
| 2309 options.offer_to_receive_video = 0; |
| 2310 caller()->SetOfferAnswerOptions(options); |
| 2311 caller()->CreateAndSetAndSignalOffer(); |
| 2312 ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout); |
| 2313 // Caller data channel should already exist (it created one). Callee data |
| 2314 // channel may not exist yet, since negotiation happens in-band, not in SDP. |
| 2315 ASSERT_NE(nullptr, caller()->data_channel()); |
| 2316 ASSERT_TRUE_WAIT(callee()->data_channel() != nullptr, kDefaultTimeout); |
| 2317 EXPECT_TRUE_WAIT(caller()->data_observer()->IsOpen(), kDefaultTimeout); |
| 2318 EXPECT_TRUE_WAIT(callee()->data_observer()->IsOpen(), kDefaultTimeout); |
| 2319 |
| 2320 // Ensure data can be sent in both directions. |
| 2321 std::string data = "hello world"; |
| 2322 caller()->data_channel()->Send(DataBuffer(data)); |
| 2323 EXPECT_EQ_WAIT(data, callee()->data_observer()->last_message(), |
| 2324 kDefaultTimeout); |
| 2325 callee()->data_channel()->Send(DataBuffer(data)); |
| 2326 EXPECT_EQ_WAIT(data, caller()->data_observer()->last_message(), |
| 2327 kDefaultTimeout); |
| 2328 } |
| 2329 |
2300 // Ensure that when the callee closes an SCTP data channel, the closing | 2330 // Ensure that when the callee closes an SCTP data channel, the closing |
2301 // procedure results in the data channel being closed for the caller as well. | 2331 // procedure results in the data channel being closed for the caller as well. |
2302 TEST_F(PeerConnectionIntegrationTest, CalleeClosesSctpDataChannel) { | 2332 TEST_F(PeerConnectionIntegrationTest, CalleeClosesSctpDataChannel) { |
2303 // Same procedure as above test. | 2333 // Same procedure as above test. |
2304 ASSERT_TRUE(CreatePeerConnectionWrappers()); | 2334 ASSERT_TRUE(CreatePeerConnectionWrappers()); |
2305 ConnectFakeSignaling(); | 2335 ConnectFakeSignaling(); |
2306 caller()->CreateDataChannel(); | 2336 caller()->CreateDataChannel(); |
2307 caller()->AddAudioVideoMediaStream(); | 2337 caller()->AddAudioVideoMediaStream(); |
2308 callee()->AddAudioVideoMediaStream(); | 2338 callee()->AddAudioVideoMediaStream(); |
2309 caller()->CreateAndSetAndSignalOffer(); | 2339 caller()->CreateAndSetAndSignalOffer(); |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2900 caller()->CreateAndSetAndSignalOffer(); | 2930 caller()->CreateAndSetAndSignalOffer(); |
2901 ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout); | 2931 ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout); |
2902 // Wait for additional audio frames to be received by the callee. | 2932 // Wait for additional audio frames to be received by the callee. |
2903 ExpectNewFramesReceivedWithWait(0, 0, kDefaultExpectedAudioFrameCount, 0, | 2933 ExpectNewFramesReceivedWithWait(0, 0, kDefaultExpectedAudioFrameCount, 0, |
2904 kMaxWaitForFramesMs); | 2934 kMaxWaitForFramesMs); |
2905 } | 2935 } |
2906 | 2936 |
2907 } // namespace | 2937 } // namespace |
2908 | 2938 |
2909 #endif // if !defined(THREAD_SANITIZER) | 2939 #endif // if !defined(THREAD_SANITIZER) |
OLD | NEW |