Commit e25b0300 authored by Philipp Hancke's avatar Philipp Hancke Committed by Commit Bot

test for ignoring empty rtp-over-tcp frames

BUG=1043805

Change-Id: I433b5c67f62f304e71777d33909fd026b8583a82
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2024847Reviewed-by: default avatarHarald Alvestrand <hta@chromium.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/master@{#739301}
parent 989692f1
...@@ -332,6 +332,24 @@ TEST_F(P2PSocketTcpTest, SendDataWithPacketOptions) { ...@@ -332,6 +332,24 @@ TEST_F(P2PSocketTcpTest, SendDataWithPacketOptions) {
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
} }
// Verify that we ignore an empty frame.
TEST_F(P2PSocketTcpTest, IgnoreEmptyFrame) {
std::vector<int8_t> response_packet;
CreateStunResponse(&response_packet);
std::string received_data;
received_data.append(IntToSize(response_packet.size()));
received_data.append(response_packet.begin(), response_packet.end());
socket_->AppendInputData(&received_data[0], received_data.size());
std::vector<int8_t> empty_packet;
received_data.resize(0);
received_data.append(IntToSize(empty_packet.size()));
received_data.append(empty_packet.begin(), empty_packet.end());
socket_->AppendInputData(&received_data[0], received_data.size());
EXPECT_CALL(*fake_client_.get(), DataReceived(_, _, _)).Times(0);
}
// Verify that we can send STUN message and that they are formatted // Verify that we can send STUN message and that they are formatted
// properly. // properly.
TEST_F(P2PSocketStunTcpTest, SendStunNoAuth) { TEST_F(P2PSocketStunTcpTest, SendStunNoAuth) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment