OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 StreamParams p(StreamParams::CreateLegacy(ssrc)); | 258 StreamParams p(StreamParams::CreateLegacy(ssrc)); |
259 ret = ret && chan1_->AddSendStream(p); | 259 ret = ret && chan1_->AddSendStream(p); |
260 ret = ret && chan1_->AddRecvStream(p); | 260 ret = ret && chan1_->AddRecvStream(p); |
261 ret = ret && chan2_->AddSendStream(p); | 261 ret = ret && chan2_->AddSendStream(p); |
262 ret = ret && chan2_->AddRecvStream(p); | 262 ret = ret && chan2_->AddRecvStream(p); |
263 return ret; | 263 return ret; |
264 } | 264 } |
265 | 265 |
266 SctpDataMediaChannel* CreateChannel(SctpFakeNetworkInterface* net, | 266 SctpDataMediaChannel* CreateChannel(SctpFakeNetworkInterface* net, |
267 SctpFakeDataReceiver* recv) { | 267 SctpFakeDataReceiver* recv) { |
268 SctpDataMediaChannel* channel = | 268 cricket::MediaConfig config; |
269 static_cast<SctpDataMediaChannel*>(engine_->CreateChannel(DCT_SCTP)); | 269 SctpDataMediaChannel* channel = static_cast<SctpDataMediaChannel*>( |
| 270 engine_->CreateChannel(DCT_SCTP, config)); |
270 channel->SetInterface(net); | 271 channel->SetInterface(net); |
271 // When data is received, pass it to the SctpFakeDataReceiver. | 272 // When data is received, pass it to the SctpFakeDataReceiver. |
272 channel->SignalDataReceived.connect( | 273 channel->SignalDataReceived.connect( |
273 recv, &SctpFakeDataReceiver::OnDataReceived); | 274 recv, &SctpFakeDataReceiver::OnDataReceived); |
274 return channel; | 275 return channel; |
275 } | 276 } |
276 | 277 |
277 bool SendData(SctpDataMediaChannel* chan, | 278 bool SendData(SctpDataMediaChannel* chan, |
278 uint32_t ssrc, | 279 uint32_t ssrc, |
279 const std::string& msg, | 280 const std::string& msg, |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 // Create a new channel 1. | 514 // Create a new channel 1. |
514 AddStream(1); | 515 AddStream(1); |
515 ASSERT_TRUE(SendData(channel1(), 1, "hi?", &result)); | 516 ASSERT_TRUE(SendData(channel1(), 1, "hi?", &result)); |
516 EXPECT_EQ(SDR_SUCCESS, result); | 517 EXPECT_EQ(SDR_SUCCESS, result); |
517 EXPECT_TRUE_WAIT(ReceivedData(receiver2(), 1, "hi?"), 1000); | 518 EXPECT_TRUE_WAIT(ReceivedData(receiver2(), 1, "hi?"), 1000); |
518 channel1()->RemoveSendStream(1); | 519 channel1()->RemoveSendStream(1); |
519 EXPECT_TRUE_WAIT(chan_2_sig_receiver.StreamCloseCount(1) == 2, 1000); | 520 EXPECT_TRUE_WAIT(chan_2_sig_receiver.StreamCloseCount(1) == 2, 1000); |
520 } | 521 } |
521 | 522 |
522 } // namespace cricket | 523 } // namespace cricket |
OLD | NEW |