| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2013 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 FakeConstraints pc_constraints; | 187 FakeConstraints pc_constraints; |
| 188 pc_constraints.AddMandatory(MediaConstraintsInterface::kEnableDtlsSrtp, | 188 pc_constraints.AddMandatory(MediaConstraintsInterface::kEnableDtlsSrtp, |
| 189 false); | 189 false); |
| 190 CreatePcs(&pc_constraints); | 190 CreatePcs(&pc_constraints); |
| 191 GetAndAddUserMedia(); | 191 GetAndAddUserMedia(); |
| 192 Negotiate(); | 192 Negotiate(); |
| 193 WaitForCallEstablished(); | 193 WaitForCallEstablished(); |
| 194 } | 194 } |
| 195 #endif // !defined(ADDRESS_SANITIZER) | 195 #endif // !defined(ADDRESS_SANITIZER) |
| 196 | 196 |
| 197 #ifdef HAVE_SCTP |
| 197 // Verifies that a DataChannel created before the negotiation can transition to | 198 // Verifies that a DataChannel created before the negotiation can transition to |
| 198 // "OPEN" and transfer data. | 199 // "OPEN" and transfer data. |
| 199 TEST_F(PeerConnectionEndToEndTest, CreateDataChannelBeforeNegotiate) { | 200 TEST_F(PeerConnectionEndToEndTest, CreateDataChannelBeforeNegotiate) { |
| 200 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); | 201 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); |
| 201 | 202 |
| 202 CreatePcs(); | 203 CreatePcs(); |
| 203 | 204 |
| 204 webrtc::DataChannelInit init; | 205 webrtc::DataChannelInit init; |
| 205 rtc::scoped_refptr<DataChannelInterface> caller_dc( | 206 rtc::scoped_refptr<DataChannelInterface> caller_dc( |
| 206 caller_->CreateDataChannel("data", init)); | 207 caller_->CreateDataChannel("data", init)); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 | 313 |
| 313 caller_dc_1->Send(webrtc::DataBuffer(message_1)); | 314 caller_dc_1->Send(webrtc::DataBuffer(message_1)); |
| 314 EXPECT_EQ_WAIT(message_1, dc_1_observer->last_message(), kMaxWait); | 315 EXPECT_EQ_WAIT(message_1, dc_1_observer->last_message(), kMaxWait); |
| 315 | 316 |
| 316 caller_dc_2->Send(webrtc::DataBuffer(message_2)); | 317 caller_dc_2->Send(webrtc::DataBuffer(message_2)); |
| 317 EXPECT_EQ_WAIT(message_2, dc_2_observer->last_message(), kMaxWait); | 318 EXPECT_EQ_WAIT(message_2, dc_2_observer->last_message(), kMaxWait); |
| 318 | 319 |
| 319 EXPECT_EQ(1U, dc_1_observer->received_message_count()); | 320 EXPECT_EQ(1U, dc_1_observer->received_message_count()); |
| 320 EXPECT_EQ(1U, dc_2_observer->received_message_count()); | 321 EXPECT_EQ(1U, dc_2_observer->received_message_count()); |
| 321 } | 322 } |
| 323 #endif // HAVE_SCTP |
| 322 | 324 |
| 323 #ifdef HAVE_QUIC | 325 #ifdef HAVE_QUIC |
| 324 // Test that QUIC data channels can be used and that messages go to the correct | 326 // Test that QUIC data channels can be used and that messages go to the correct |
| 325 // remote data channel when both peers want to use QUIC. It is assumed that the | 327 // remote data channel when both peers want to use QUIC. It is assumed that the |
| 326 // application has externally negotiated the data channel parameters. | 328 // application has externally negotiated the data channel parameters. |
| 327 TEST_F(PeerConnectionEndToEndTest, MessageTransferBetweenQuicDataChannels) { | 329 TEST_F(PeerConnectionEndToEndTest, MessageTransferBetweenQuicDataChannels) { |
| 328 config_.enable_quic = true; | 330 config_.enable_quic = true; |
| 329 CreatePcs(); | 331 CreatePcs(); |
| 330 | 332 |
| 331 webrtc::DataChannelInit init_1; | 333 webrtc::DataChannelInit init_1; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 EXPECT_EQ_WAIT(message_1, dc_1_observer->last_message(), kMaxWait); | 391 EXPECT_EQ_WAIT(message_1, dc_1_observer->last_message(), kMaxWait); |
| 390 | 392 |
| 391 callee_dc_2->Send(webrtc::DataBuffer(message_2)); | 393 callee_dc_2->Send(webrtc::DataBuffer(message_2)); |
| 392 EXPECT_EQ_WAIT(message_2, dc_2_observer->last_message(), kMaxWait); | 394 EXPECT_EQ_WAIT(message_2, dc_2_observer->last_message(), kMaxWait); |
| 393 | 395 |
| 394 EXPECT_EQ(1U, dc_1_observer->received_message_count()); | 396 EXPECT_EQ(1U, dc_1_observer->received_message_count()); |
| 395 EXPECT_EQ(1U, dc_2_observer->received_message_count()); | 397 EXPECT_EQ(1U, dc_2_observer->received_message_count()); |
| 396 } | 398 } |
| 397 #endif // HAVE_QUIC | 399 #endif // HAVE_QUIC |
| 398 | 400 |
| 401 #ifdef HAVE_SCTP |
| 399 // Verifies that a DataChannel added from an OPEN message functions after | 402 // Verifies that a DataChannel added from an OPEN message functions after |
| 400 // a channel has been previously closed (webrtc issue 3778). | 403 // a channel has been previously closed (webrtc issue 3778). |
| 401 // This previously failed because the new channel re-uses the ID of the closed | 404 // This previously failed because the new channel re-uses the ID of the closed |
| 402 // channel, and the closed channel was incorrectly still assigned to the id. | 405 // channel, and the closed channel was incorrectly still assigned to the id. |
| 403 // TODO(deadbeef): This is disabled because there's currently a race condition | 406 // TODO(deadbeef): This is disabled because there's currently a race condition |
| 404 // caused by the fact that a data channel signals that it's closed before it | 407 // caused by the fact that a data channel signals that it's closed before it |
| 405 // really is. Re-enable this test once that's fixed. | 408 // really is. Re-enable this test once that's fixed. |
| 406 // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=4453 | 409 // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=4453 |
| 407 TEST_F(PeerConnectionEndToEndTest, | 410 TEST_F(PeerConnectionEndToEndTest, |
| 408 DISABLED_DataChannelFromOpenWorksAfterClose) { | 411 DISABLED_DataChannelFromOpenWorksAfterClose) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 WaitForDataChannelsToOpen(caller_dc, callee_signaled_data_channels_, 0); | 451 WaitForDataChannelsToOpen(caller_dc, callee_signaled_data_channels_, 0); |
| 449 // This removes the reference to the remote data channel that we hold. | 452 // This removes the reference to the remote data channel that we hold. |
| 450 callee_signaled_data_channels_.clear(); | 453 callee_signaled_data_channels_.clear(); |
| 451 caller_dc->Close(); | 454 caller_dc->Close(); |
| 452 EXPECT_EQ_WAIT(DataChannelInterface::kClosed, caller_dc->state(), kMaxWait); | 455 EXPECT_EQ_WAIT(DataChannelInterface::kClosed, caller_dc->state(), kMaxWait); |
| 453 | 456 |
| 454 // Wait for a bit longer so the remote data channel will receive the | 457 // Wait for a bit longer so the remote data channel will receive the |
| 455 // close message and be destroyed. | 458 // close message and be destroyed. |
| 456 rtc::Thread::Current()->ProcessMessages(100); | 459 rtc::Thread::Current()->ProcessMessages(100); |
| 457 } | 460 } |
| 461 #endif // HAVE_SCTP |
| OLD | NEW |