OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 | 357 |
358 caller_dc_1->Send(webrtc::DataBuffer(message_1)); | 358 caller_dc_1->Send(webrtc::DataBuffer(message_1)); |
359 EXPECT_EQ_WAIT(message_1, dc_1_observer->last_message(), kMaxWait); | 359 EXPECT_EQ_WAIT(message_1, dc_1_observer->last_message(), kMaxWait); |
360 | 360 |
361 caller_dc_2->Send(webrtc::DataBuffer(message_2)); | 361 caller_dc_2->Send(webrtc::DataBuffer(message_2)); |
362 EXPECT_EQ_WAIT(message_2, dc_2_observer->last_message(), kMaxWait); | 362 EXPECT_EQ_WAIT(message_2, dc_2_observer->last_message(), kMaxWait); |
363 | 363 |
364 EXPECT_EQ(1U, dc_1_observer->received_message_count()); | 364 EXPECT_EQ(1U, dc_1_observer->received_message_count()); |
365 EXPECT_EQ(1U, dc_2_observer->received_message_count()); | 365 EXPECT_EQ(1U, dc_2_observer->received_message_count()); |
366 } | 366 } |
| 367 |
| 368 // Verifies that a DataChannel added from an OPEN message functions after |
| 369 // a channel has been previously closed (webrtc issue 3778). |
| 370 // This previously failed because the new channel re-uses the ID of the closed |
| 371 // channel, and the closed channel was incorrectly still assigned to the id. |
| 372 // TODO(deadbeef): This is disabled because there's currently a race condition |
| 373 // caused by the fact that a data channel signals that it's closed before it |
| 374 // really is. Re-enable this test once that's fixed. |
| 375 TEST_F(PeerConnectionEndToEndTest, |
| 376 DISABLED_DataChannelFromOpenWorksAfterClose) { |
| 377 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); |
| 378 |
| 379 CreatePcs(); |
| 380 |
| 381 webrtc::DataChannelInit init; |
| 382 rtc::scoped_refptr<DataChannelInterface> caller_dc( |
| 383 caller_->CreateDataChannel("data", init)); |
| 384 |
| 385 Negotiate(); |
| 386 WaitForConnection(); |
| 387 |
| 388 WaitForDataChannelsToOpen(caller_dc, callee_signaled_data_channels_, 0); |
| 389 CloseDataChannels(caller_dc, callee_signaled_data_channels_, 0); |
| 390 |
| 391 // Create a new channel and ensure it works after closing the previous one. |
| 392 caller_dc = caller_->CreateDataChannel("data2", init); |
| 393 |
| 394 WaitForDataChannelsToOpen(caller_dc, callee_signaled_data_channels_, 1); |
| 395 TestDataChannelSendAndReceive(caller_dc, callee_signaled_data_channels_[1]); |
| 396 |
| 397 CloseDataChannels(caller_dc, callee_signaled_data_channels_, 1); |
| 398 } |
OLD | NEW |