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 |
11 #include <errno.h> | 11 #include <errno.h> |
12 #include <stdarg.h> | 12 #include <stdarg.h> |
13 #include <stdio.h> | 13 #include <stdio.h> |
14 | 14 |
15 #include <memory> | 15 #include <memory> |
16 #include <string> | 16 #include <string> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "webrtc/base/bind.h" | 19 #include "webrtc/base/bind.h" |
20 #include "webrtc/base/buffer.h" | 20 #include "webrtc/base/buffer.h" |
21 #include "webrtc/base/criticalsection.h" | 21 #include "webrtc/base/criticalsection.h" |
22 #include "webrtc/base/gunit.h" | 22 #include "webrtc/base/gunit.h" |
23 #include "webrtc/base/helpers.h" | 23 #include "webrtc/base/helpers.h" |
24 #include "webrtc/base/messagehandler.h" | 24 #include "webrtc/base/messagehandler.h" |
25 #include "webrtc/base/messagequeue.h" | 25 #include "webrtc/base/messagequeue.h" |
26 #include "webrtc/base/ssladapter.h" | 26 #include "webrtc/base/ssladapter.h" |
27 #include "webrtc/base/thread.h" | 27 #include "webrtc/base/thread.h" |
28 #include "webrtc/media/base/constants.h" | |
29 #include "webrtc/media/base/mediachannel.h" | 28 #include "webrtc/media/base/mediachannel.h" |
| 29 #include "webrtc/media/base/mediaconstants.h" |
30 #include "webrtc/media/sctp/sctpdataengine.h" | 30 #include "webrtc/media/sctp/sctpdataengine.h" |
31 | 31 |
32 enum { | 32 enum { |
33 MSG_PACKET = 1, | 33 MSG_PACKET = 1, |
34 }; | 34 }; |
35 | 35 |
36 // Fake NetworkInterface that sends/receives sctp packets. The one in | 36 // Fake NetworkInterface that sends/receives sctp packets. The one in |
37 // webrtc/media/base/fakenetworkinterface.h only works with rtp/rtcp. | 37 // webrtc/media/base/fakenetworkinterface.h only works with rtp/rtcp. |
38 class SctpFakeNetworkInterface : public cricket::MediaChannel::NetworkInterface, | 38 class SctpFakeNetworkInterface : public cricket::MediaChannel::NetworkInterface, |
39 public rtc::MessageHandler { | 39 public rtc::MessageHandler { |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 // Channel 1 is gone now. | 518 // Channel 1 is gone now. |
519 | 519 |
520 // Create a new channel 1. | 520 // Create a new channel 1. |
521 AddStream(1); | 521 AddStream(1); |
522 ASSERT_TRUE(SendData(channel1(), 1, "hi?", &result)); | 522 ASSERT_TRUE(SendData(channel1(), 1, "hi?", &result)); |
523 EXPECT_EQ(cricket::SDR_SUCCESS, result); | 523 EXPECT_EQ(cricket::SDR_SUCCESS, result); |
524 EXPECT_TRUE_WAIT(ReceivedData(receiver2(), 1, "hi?"), 1000); | 524 EXPECT_TRUE_WAIT(ReceivedData(receiver2(), 1, "hi?"), 1000); |
525 channel1()->RemoveSendStream(1); | 525 channel1()->RemoveSendStream(1); |
526 EXPECT_TRUE_WAIT(chan_2_sig_receiver.StreamCloseCount(1) == 2, 1000); | 526 EXPECT_TRUE_WAIT(chan_2_sig_receiver.StreamCloseCount(1) == 2, 1000); |
527 } | 527 } |
OLD | NEW |