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 2295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2306 // Ensure data can be sent in both directions. | 2306 // Ensure data can be sent in both directions. |
2307 std::string data = "hello world"; | 2307 std::string data = "hello world"; |
2308 caller()->data_channel()->Send(DataBuffer(data)); | 2308 caller()->data_channel()->Send(DataBuffer(data)); |
2309 EXPECT_EQ_WAIT(data, callee()->data_observer()->last_message(), | 2309 EXPECT_EQ_WAIT(data, callee()->data_observer()->last_message(), |
2310 kDefaultTimeout); | 2310 kDefaultTimeout); |
2311 callee()->data_channel()->Send(DataBuffer(data)); | 2311 callee()->data_channel()->Send(DataBuffer(data)); |
2312 EXPECT_EQ_WAIT(data, caller()->data_observer()->last_message(), | 2312 EXPECT_EQ_WAIT(data, caller()->data_observer()->last_message(), |
2313 kDefaultTimeout); | 2313 kDefaultTimeout); |
2314 } | 2314 } |
2315 | 2315 |
| 2316 // This test sets up a call between two parties with an SCTP data channel only. |
| 2317 TEST_F(PeerConnectionIntegrationTest, EndToEndCallWithSctpDataChannelOnly) { |
| 2318 ASSERT_TRUE(CreatePeerConnectionWrappers()); |
| 2319 ConnectFakeSignaling(); |
| 2320 // Expect that data channel created on caller side will show up for callee as |
| 2321 // well. |
| 2322 caller()->CreateDataChannel(); |
| 2323 PeerConnectionInterface::RTCOfferAnswerOptions options; |
| 2324 options.offer_to_receive_audio = 0; |
| 2325 options.offer_to_receive_video = 0; |
| 2326 caller()->SetOfferAnswerOptions(options); |
| 2327 caller()->CreateAndSetAndSignalOffer(); |
| 2328 ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout); |
| 2329 // Caller data channel should already exist (it created one). Callee data |
| 2330 // channel may not exist yet, since negotiation happens in-band, not in SDP. |
| 2331 ASSERT_NE(nullptr, caller()->data_channel()); |
| 2332 ASSERT_TRUE_WAIT(callee()->data_channel() != nullptr, kDefaultTimeout); |
| 2333 EXPECT_TRUE_WAIT(caller()->data_observer()->IsOpen(), kDefaultTimeout); |
| 2334 EXPECT_TRUE_WAIT(callee()->data_observer()->IsOpen(), kDefaultTimeout); |
| 2335 |
| 2336 // Ensure data can be sent in both directions. |
| 2337 std::string data = "hello world"; |
| 2338 caller()->data_channel()->Send(DataBuffer(data)); |
| 2339 EXPECT_EQ_WAIT(data, callee()->data_observer()->last_message(), |
| 2340 kDefaultTimeout); |
| 2341 callee()->data_channel()->Send(DataBuffer(data)); |
| 2342 EXPECT_EQ_WAIT(data, caller()->data_observer()->last_message(), |
| 2343 kDefaultTimeout); |
| 2344 } |
| 2345 |
2316 // Ensure that when the callee closes an SCTP data channel, the closing | 2346 // Ensure that when the callee closes an SCTP data channel, the closing |
2317 // procedure results in the data channel being closed for the caller as well. | 2347 // procedure results in the data channel being closed for the caller as well. |
2318 TEST_F(PeerConnectionIntegrationTest, CalleeClosesSctpDataChannel) { | 2348 TEST_F(PeerConnectionIntegrationTest, CalleeClosesSctpDataChannel) { |
2319 // Same procedure as above test. | 2349 // Same procedure as above test. |
2320 ASSERT_TRUE(CreatePeerConnectionWrappers()); | 2350 ASSERT_TRUE(CreatePeerConnectionWrappers()); |
2321 ConnectFakeSignaling(); | 2351 ConnectFakeSignaling(); |
2322 caller()->CreateDataChannel(); | 2352 caller()->CreateDataChannel(); |
2323 caller()->AddAudioVideoMediaStream(); | 2353 caller()->AddAudioVideoMediaStream(); |
2324 callee()->AddAudioVideoMediaStream(); | 2354 callee()->AddAudioVideoMediaStream(); |
2325 caller()->CreateAndSetAndSignalOffer(); | 2355 caller()->CreateAndSetAndSignalOffer(); |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2905 caller()->CreateAndSetAndSignalOffer(); | 2935 caller()->CreateAndSetAndSignalOffer(); |
2906 ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout); | 2936 ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout); |
2907 // Wait for additional audio frames to be received by the callee. | 2937 // Wait for additional audio frames to be received by the callee. |
2908 ExpectNewFramesReceivedWithWait(0, 0, kDefaultExpectedAudioFrameCount, 0, | 2938 ExpectNewFramesReceivedWithWait(0, 0, kDefaultExpectedAudioFrameCount, 0, |
2909 kMaxWaitForFramesMs); | 2939 kMaxWaitForFramesMs); |
2910 } | 2940 } |
2911 | 2941 |
2912 } // namespace | 2942 } // namespace |
2913 | 2943 |
2914 #endif // if !defined(THREAD_SANITIZER) | 2944 #endif // if !defined(THREAD_SANITIZER) |
OLD | NEW |