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

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

Issue 2393233002: Remove OnDataAvailable() notification when trailers are to be delivered (Closed)
Patch Set: Address Andrei's comments Created 4 years, 2 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/quic_chromium_client_stream_test.cc
diff --git a/net/quic/chromium/quic_chromium_client_stream_test.cc b/net/quic/chromium/quic_chromium_client_stream_test.cc
index b985c31447e57640c3782e9e779740f26bcdb0ed..30587d05b42d2c82096f5a32ebc596153f8ce9f0 100644
--- a/net/quic/chromium/quic_chromium_client_stream_test.cc
+++ b/net/quic/chromium/quic_chromium_client_stream_test.cc
@@ -417,28 +417,14 @@ TEST_P(QuicChromiumClientStreamTest, MarkTrailersConsumedWhenNotifyDelegate) {
stream_->OnStreamHeadersComplete(true, uncompressed_trailers.length());
EXPECT_FALSE(stream_->IsDoneReading());
- // Now the pending should complete. Make sure that IsDoneReading() is false
- // even though ReadData returns 0 byte, because OnHeadersAvailable callback
- // comes after this OnDataAvailable callback.
base::RunLoop run_loop2;
- EXPECT_CALL(delegate_, OnDataAvailable())
- .Times(1)
- .WillOnce(testing::DoAll(
- testing::Invoke(CreateFunctor(&QuicChromiumClientStreamTest::ReadData,
- base::Unretained(this), StringPiece())),
- testing::InvokeWithoutArgs([&run_loop2]() { run_loop2.Quit(); })));
- run_loop2.Run();
- // Make sure that the stream is not closed, even though ReadData returns 0.
- EXPECT_FALSE(stream_->IsDoneReading());
-
- // The OnHeadersAvailable call should follow.
- base::RunLoop run_loop3;
EXPECT_CALL(delegate_,
OnHeadersAvailableMock(_, uncompressed_trailers.length()))
.WillOnce(
- testing::InvokeWithoutArgs([&run_loop3]() { run_loop3.Quit(); }));
+ testing::InvokeWithoutArgs([&run_loop2]() { run_loop2.Quit(); }));
+
+ run_loop2.Run();
- run_loop3.Run();
// Make sure the stream is properly closed since trailers and data are all
// consumed.
EXPECT_TRUE(stream_->IsDoneReading());

Powered by Google App Engine
This is Rietveld 408576698