Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Unified Diff: net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc

Issue 2908243002: Remove QuicChromiumClientStream::Delegate in favor of async methods. (Closed)
Patch Set: Rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc
diff --git a/net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc b/net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc
index b77499b1f4d0efb478c3e7f2705aea6fcf21c71b..c5f791b4738e715a37e1ddde2bc6d737d63ee879 100644
--- a/net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc
+++ b/net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc
@@ -1585,8 +1585,6 @@ TEST_P(BidirectionalStreamQuicImplTest, ServerSendsRstAfterHeaders) {
// Server sends a Rst.
ProcessPacket(ConstructServerRstStreamPacket(1));
- EXPECT_TRUE(delegate->on_failed_called());
-
TestCompletionCallback cb;
EXPECT_THAT(delegate->ReadData(cb.callback()),
IsError(ERR_QUIC_PROTOCOL_ERROR));
@@ -1649,7 +1647,7 @@ TEST_P(BidirectionalStreamQuicImplTest, ServerSendsRstAfterReadData) {
// Server sends a Rst.
ProcessPacket(ConstructServerRstStreamPacket(3));
- EXPECT_TRUE(delegate->on_failed_called());
+ delegate->WaitUntilNextCallback(kOnFailed);
EXPECT_THAT(delegate->ReadData(cb.callback()),
IsError(ERR_QUIC_PROTOCOL_ERROR));
@@ -1703,15 +1701,16 @@ TEST_P(BidirectionalStreamQuicImplTest, SessionClosedBeforeReadData) {
EXPECT_THAT(rv, IsError(ERR_IO_PENDING));
session()->connection()->CloseConnection(
QUIC_NO_ERROR, "test", ConnectionCloseBehavior::SILENT_CLOSE);
+ delegate->WaitUntilNextCallback(kOnFailed);
EXPECT_TRUE(delegate->on_failed_called());
// Try to send data after OnFailed(), should not get called back.
scoped_refptr<StringIOBuffer> buf(new StringIOBuffer(kUploadData));
delegate->SendData(buf, buf->size(), false);
- base::RunLoop().RunUntilIdle();
- EXPECT_THAT(delegate->ReadData(cb.callback()), IsError(ERR_UNEXPECTED));
- EXPECT_THAT(delegate->error(), IsError(ERR_UNEXPECTED));
+ EXPECT_THAT(delegate->ReadData(cb.callback()),
+ IsError(ERR_QUIC_PROTOCOL_ERROR));
+ EXPECT_THAT(delegate->error(), IsError(ERR_QUIC_PROTOCOL_ERROR));
EXPECT_EQ(0, delegate->on_data_read_count());
EXPECT_EQ(0, delegate->on_data_sent_count());
EXPECT_EQ(kProtoQUIC, delegate->GetProtocol());

Powered by Google App Engine
This is Rietveld 408576698