Index: webrtc/media/sctp/sctptransport_unittest.cc |
diff --git a/webrtc/media/sctp/sctptransport_unittest.cc b/webrtc/media/sctp/sctptransport_unittest.cc |
index 7fcbd9ce8eb5fd7aca6b65bcb1185e8e08176757..b8495d081a5fbc94deb6d13a38be3ab7b8dc1399 100644 |
--- a/webrtc/media/sctp/sctptransport_unittest.cc |
+++ b/webrtc/media/sctp/sctptransport_unittest.cc |
@@ -130,6 +130,10 @@ class SctpTransportTest : public testing::Test, public sigslot::has_slots<> { |
static void SetUpTestCase() {} |
void SetupConnectedTransportsWithTwoStreams() { |
+ SetupConnectedTransportsWithTwoStreams(kTransport1Port, kTransport2Port); |
+ } |
+ |
+ void SetupConnectedTransportsWithTwoStreams(int port1, int port2) { |
fake_dtls1_.reset(new FakeDtlsTransport("fake dtls 1", 0)); |
fake_dtls2_.reset(new FakeDtlsTransport("fake dtls 2", 0)); |
recv1_.reset(new SctpFakeDataReceiver()); |
@@ -153,8 +157,8 @@ class SctpTransportTest : public testing::Test, public sigslot::has_slots<> { |
LOG(LS_VERBOSE) << "Connect the transports -----------------------------"; |
// Both transports need to have started (with matching ports) for an |
// association to be formed. |
- transport1_->Start(kTransport1Port, kTransport2Port); |
- transport2_->Start(kTransport2Port, kTransport1Port); |
+ transport1_->Start(port1, port2); |
+ transport2_->Start(port2, port1); |
} |
bool AddStream(int sid) { |
@@ -451,6 +455,20 @@ TEST_F(SctpTransportTest, SendDataWithNonexistentStreamFails) { |
EXPECT_EQ(SDR_ERROR, result); |
} |
+TEST_F(SctpTransportTest, SendDataHighPorts) { |
+ SetupConnectedTransportsWithTwoStreams(32768, 32769); |
+ |
+ SendDataResult result; |
+ ASSERT_TRUE(SendData(transport1(), 1, "hello?", &result)); |
+ EXPECT_EQ(SDR_SUCCESS, result); |
+ EXPECT_TRUE_WAIT(ReceivedData(receiver2(), 1, "hello?"), kDefaultTimeout); |
+ |
+ ASSERT_TRUE(SendData(transport2(), 2, "hi transport1", &result)); |
+ EXPECT_EQ(SDR_SUCCESS, result); |
+ EXPECT_TRUE_WAIT(ReceivedData(receiver1(), 2, "hi transport1"), |
+ kDefaultTimeout); |
+} |
+ |
TEST_F(SctpTransportTest, ClosesRemoteStream) { |
SetupConnectedTransportsWithTwoStreams(); |
SignalTransportClosedObserver transport1_sig_receiver, |