diff options
Diffstat (limited to 'chromium/net/third_party/quiche/src/quic/quartc/quartc_stream_test.cc')
-rw-r--r-- | chromium/net/third_party/quiche/src/quic/quartc/quartc_stream_test.cc | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/chromium/net/third_party/quiche/src/quic/quartc/quartc_stream_test.cc b/chromium/net/third_party/quiche/src/quic/quartc/quartc_stream_test.cc index c8a68fcefff..0e972e50aff 100644 --- a/chromium/net/third_party/quiche/src/quic/quartc/quartc_stream_test.cc +++ b/chromium/net/third_party/quiche/src/quic/quartc/quartc_stream_test.cc @@ -27,7 +27,6 @@ #include "net/third_party/quiche/src/quic/core/quic_versions.h" #include "net/third_party/quiche/src/quic/core/quic_write_blocked_list.h" #include "net/third_party/quiche/src/quic/platform/api/quic_clock.h" -#include "net/third_party/quiche/src/quic/platform/api/quic_endian.h" #include "net/third_party/quiche/src/quic/platform/api/quic_flags.h" #include "net/third_party/quiche/src/quic/platform/api/quic_ip_address.h" #include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h" @@ -36,8 +35,12 @@ #include "net/third_party/quiche/src/quic/quartc/quartc_factory.h" #include "net/third_party/quiche/src/quic/test_tools/mock_clock.h" #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h" +#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h" #include "net/third_party/quiche/src/spdy/core/spdy_protocol.h" +using ::quic::test::IsQuicStreamNoError; +using ::quic::test::IsStreamError; + namespace quic { namespace { @@ -73,7 +76,7 @@ class MockQuicSession : public QuicSession { // WritevData does not pass down a iovec, data is saved in stream before // data is consumed. Retrieve data from stream. char* buf = new char[write_length]; - QuicDataWriter writer(write_length, buf, NETWORK_BYTE_ORDER); + QuicDataWriter writer(write_length, buf, quiche::NETWORK_BYTE_ORDER); if (write_length > 0) { stream->WriteStreamData(offset, write_length, &writer); } @@ -419,7 +422,7 @@ TEST_F(QuartcStreamTest, TestCancelOnLossDisabled) { stream_->OnCanWrite(); EXPECT_EQ("Foo barFoo bar", write_buffer_); - EXPECT_EQ(stream_->stream_error(), QUIC_STREAM_NO_ERROR); + EXPECT_THAT(stream_->stream_error(), IsQuicStreamNoError()); } TEST_F(QuartcStreamTest, TestCancelOnLossEnabled) { @@ -436,7 +439,7 @@ TEST_F(QuartcStreamTest, TestCancelOnLossEnabled) { stream_->OnCanWrite(); EXPECT_EQ("Foo bar", write_buffer_); - EXPECT_EQ(stream_->stream_error(), QUIC_STREAM_CANCELLED); + EXPECT_THAT(stream_->stream_error(), IsStreamError(QUIC_STREAM_CANCELLED)); } TEST_F(QuartcStreamTest, MaxRetransmissionsAbsent) { @@ -456,7 +459,7 @@ TEST_F(QuartcStreamTest, MaxRetransmissionsAbsent) { stream_->OnCanWrite(); EXPECT_EQ("Foo barFoo bar", write_buffer_); - EXPECT_EQ(stream_->stream_error(), QUIC_STREAM_NO_ERROR); + EXPECT_THAT(stream_->stream_error(), IsQuicStreamNoError()); } TEST_F(QuartcStreamTest, MaxRetransmissionsSet) { @@ -483,7 +486,7 @@ TEST_F(QuartcStreamTest, MaxRetransmissionsSet) { stream_->OnCanWrite(); EXPECT_EQ("Foo barFoo barFoo bar", write_buffer_); - EXPECT_EQ(stream_->stream_error(), QUIC_STREAM_CANCELLED); + EXPECT_THAT(stream_->stream_error(), IsStreamError(QUIC_STREAM_CANCELLED)); } TEST_F(QuartcStreamTest, MaxRetransmissionsDisjointFrames) { @@ -542,7 +545,7 @@ TEST_F(QuartcStreamTest, MaxRetransmissionsOverlappingFrames) { stream_->OnCanWrite(); EXPECT_EQ("Foo barFoo bar", write_buffer_); - EXPECT_EQ(stream_->stream_error(), QUIC_STREAM_CANCELLED); + EXPECT_THAT(stream_->stream_error(), IsStreamError(QUIC_STREAM_CANCELLED)); } TEST_F(QuartcStreamTest, MaxRetransmissionsWithAckedFrame) { @@ -579,7 +582,7 @@ TEST_F(QuartcStreamTest, MaxRetransmissionsWithAckedFrame) { // QuartcStream should be cancelled, but it stopped tracking the lost bytes // after they were acked, so it's not. - EXPECT_EQ(stream_->stream_error(), QUIC_STREAM_NO_ERROR); + EXPECT_THAT(stream_->stream_error(), IsQuicStreamNoError()); } TEST_F(QuartcStreamTest, TestBytesPendingRetransmission) { @@ -605,7 +608,7 @@ TEST_F(QuartcStreamTest, TestBytesPendingRetransmission) { EXPECT_EQ(mock_stream_delegate_->last_bytes_pending_retransmission(), 0u); EXPECT_EQ("Foo barFoo bar", write_buffer_); - EXPECT_EQ(stream_->stream_error(), QUIC_STREAM_NO_ERROR); + EXPECT_THAT(stream_->stream_error(), IsQuicStreamNoError()); } TEST_F(QuartcStreamTest, TestBytesPendingRetransmissionWithCancelOnLoss) { @@ -631,7 +634,7 @@ TEST_F(QuartcStreamTest, TestBytesPendingRetransmissionWithCancelOnLoss) { EXPECT_EQ(mock_stream_delegate_->last_bytes_pending_retransmission(), 0u); EXPECT_EQ("Foo bar", write_buffer_); - EXPECT_EQ(stream_->stream_error(), QUIC_STREAM_CANCELLED); + EXPECT_THAT(stream_->stream_error(), IsStreamError(QUIC_STREAM_CANCELLED)); } } // namespace |