dcsctp: Add test for stream reset pending
Bug: None Change-Id: Ida040461dda53b438d88df4a38518f334cadc379 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361861 Reviewed-by: Florent Castelli <orphis@webrtc.org> Commit-Queue: Victor Boivie <boivie@webrtc.org> Auto-Submit: Victor Boivie <boivie@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42975}
This commit is contained in:
parent
c9aaf11985
commit
7929ef578a
@ -1073,6 +1073,38 @@ TEST_P(DcSctpSocketParametrizedTest, ResetStream) {
|
|||||||
MaybeHandoverSocketAndSendMessage(a, std::move(z));
|
MaybeHandoverSocketAndSendMessage(a, std::move(z));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(DcSctpSocketTest, SendReconfigWhenStreamsReady) {
|
||||||
|
DcSctpOptions options = {.cwnd_mtus_initial = 1};
|
||||||
|
SocketUnderTest a("A", options);
|
||||||
|
SocketUnderTest z("Z", options);
|
||||||
|
|
||||||
|
ConnectSockets(a, z);
|
||||||
|
|
||||||
|
// Send a message so large so that it will not be sent in full, and still
|
||||||
|
// remaining in the send queue.
|
||||||
|
a.socket.Send(DcSctpMessage(StreamID(1), PPID(51),
|
||||||
|
std::vector<uint8_t>(options.mtu * 3)),
|
||||||
|
{.unordered = IsUnordered(false)});
|
||||||
|
|
||||||
|
// Reset the outgoing stream. RECONFIG can't be sent immediately as the stream
|
||||||
|
// is pending (not paused).
|
||||||
|
a.socket.ResetStreams(std::vector<StreamID>({StreamID(1)}));
|
||||||
|
|
||||||
|
// This message sent directly after should be received eventually.
|
||||||
|
a.socket.Send(DcSctpMessage(StreamID(1), PPID(53), std::vector<uint8_t>(100)),
|
||||||
|
{.unordered = IsUnordered(false)});
|
||||||
|
|
||||||
|
ExchangeMessagesAndAdvanceTime(a, z);
|
||||||
|
|
||||||
|
std::optional<DcSctpMessage> msg1 = z.cb.ConsumeReceivedMessage();
|
||||||
|
ASSERT_TRUE(msg1.has_value());
|
||||||
|
EXPECT_EQ(msg1->ppid(), PPID(51));
|
||||||
|
|
||||||
|
std::optional<DcSctpMessage> msg2 = z.cb.ConsumeReceivedMessage();
|
||||||
|
ASSERT_TRUE(msg2.has_value());
|
||||||
|
EXPECT_EQ(msg2->ppid(), PPID(53));
|
||||||
|
}
|
||||||
|
|
||||||
TEST_P(DcSctpSocketParametrizedTest, ResetStreamWillMakeChunksStartAtZeroSsn) {
|
TEST_P(DcSctpSocketParametrizedTest, ResetStreamWillMakeChunksStartAtZeroSsn) {
|
||||||
SocketUnderTest a("A");
|
SocketUnderTest a("A");
|
||||||
auto z = std::make_unique<SocketUnderTest>("Z");
|
auto z = std::make_unique<SocketUnderTest>("Z");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user