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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 TestDataChannelSendAndReceive(caller_dc, callee_signaled_data_channels_[0]); | 209 TestDataChannelSendAndReceive(caller_dc, callee_signaled_data_channels_[0]); |
210 TestDataChannelSendAndReceive(callee_dc, caller_signaled_data_channels_[0]); | 210 TestDataChannelSendAndReceive(callee_dc, caller_signaled_data_channels_[0]); |
211 | 211 |
212 CloseDataChannels(caller_dc, callee_signaled_data_channels_, 0); | 212 CloseDataChannels(caller_dc, callee_signaled_data_channels_, 0); |
213 CloseDataChannels(callee_dc, caller_signaled_data_channels_, 0); | 213 CloseDataChannels(callee_dc, caller_signaled_data_channels_, 0); |
214 } | 214 } |
215 | 215 |
216 // Verifies that a DataChannel created after the negotiation can transition to | 216 // Verifies that a DataChannel created after the negotiation can transition to |
217 // "OPEN" and transfer data. | 217 // "OPEN" and transfer data. |
218 #if defined(MEMORY_SANITIZER) | 218 TEST_F(PeerConnectionEndToEndTest, CreateDataChannelAfterNegotiate) { |
219 // Fails under MemorySanitizer: | |
220 // See https://code.google.com/p/webrtc/issues/detail?id=3980. | |
221 #define MAYBE_CreateDataChannelAfterNegotiate DISABLED_CreateDataChannelAfterNeg
otiate | |
222 #else | |
223 #define MAYBE_CreateDataChannelAfterNegotiate CreateDataChannelAfterNegotiate | |
224 #endif | |
225 TEST_F(PeerConnectionEndToEndTest, MAYBE_CreateDataChannelAfterNegotiate) { | |
226 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); | 219 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); |
227 | 220 |
228 CreatePcs(); | 221 CreatePcs(); |
229 | 222 |
230 webrtc::DataChannelInit init; | 223 webrtc::DataChannelInit init; |
231 | 224 |
232 // This DataChannel is for creating the data content in the negotiation. | 225 // This DataChannel is for creating the data content in the negotiation. |
233 rtc::scoped_refptr<DataChannelInterface> dummy( | 226 rtc::scoped_refptr<DataChannelInterface> dummy( |
234 caller_->CreateDataChannel("data", init)); | 227 caller_->CreateDataChannel("data", init)); |
235 Negotiate(); | 228 Negotiate(); |
236 WaitForConnection(); | 229 WaitForConnection(); |
237 | 230 |
238 // Creates new DataChannels after the negotiation and verifies their states. | 231 // Wait for the data channel created pre-negotiation to be opened. |
| 232 WaitForDataChannelsToOpen(dummy, callee_signaled_data_channels_, 0); |
| 233 |
| 234 // Create new DataChannels after the negotiation and verify their states. |
239 rtc::scoped_refptr<DataChannelInterface> caller_dc( | 235 rtc::scoped_refptr<DataChannelInterface> caller_dc( |
240 caller_->CreateDataChannel("hello", init)); | 236 caller_->CreateDataChannel("hello", init)); |
241 rtc::scoped_refptr<DataChannelInterface> callee_dc( | 237 rtc::scoped_refptr<DataChannelInterface> callee_dc( |
242 callee_->CreateDataChannel("hello", init)); | 238 callee_->CreateDataChannel("hello", init)); |
243 | 239 |
244 WaitForDataChannelsToOpen(caller_dc, callee_signaled_data_channels_, 1); | 240 WaitForDataChannelsToOpen(caller_dc, callee_signaled_data_channels_, 1); |
245 WaitForDataChannelsToOpen(callee_dc, caller_signaled_data_channels_, 0); | 241 WaitForDataChannelsToOpen(callee_dc, caller_signaled_data_channels_, 0); |
246 | 242 |
247 TestDataChannelSendAndReceive(caller_dc, callee_signaled_data_channels_[1]); | 243 TestDataChannelSendAndReceive(caller_dc, callee_signaled_data_channels_[1]); |
248 TestDataChannelSendAndReceive(callee_dc, caller_signaled_data_channels_[0]); | 244 TestDataChannelSendAndReceive(callee_dc, caller_signaled_data_channels_[0]); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 WaitForDataChannelsToOpen(caller_dc, callee_signaled_data_channels_, 0); | 364 WaitForDataChannelsToOpen(caller_dc, callee_signaled_data_channels_, 0); |
369 // This removes the reference to the remote data channel that we hold. | 365 // This removes the reference to the remote data channel that we hold. |
370 callee_signaled_data_channels_.clear(); | 366 callee_signaled_data_channels_.clear(); |
371 caller_dc->Close(); | 367 caller_dc->Close(); |
372 EXPECT_EQ_WAIT(DataChannelInterface::kClosed, caller_dc->state(), kMaxWait); | 368 EXPECT_EQ_WAIT(DataChannelInterface::kClosed, caller_dc->state(), kMaxWait); |
373 | 369 |
374 // Wait for a bit longer so the remote data channel will receive the | 370 // Wait for a bit longer so the remote data channel will receive the |
375 // close message and be destroyed. | 371 // close message and be destroyed. |
376 rtc::Thread::Current()->ProcessMessages(100); | 372 rtc::Thread::Current()->ProcessMessages(100); |
377 } | 373 } |
OLD | NEW |