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

Side by Side Diff: net/quic/quic_spdy_stream_test.cc

Issue 1961573002: Avoids the "re-encode HPACK as SPDY3" step. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update new test Created 4 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 unified diff | Download patch
« no previous file with comments | « net/quic/quic_spdy_stream.cc ('k') | net/quic/spdy_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_spdy_stream.h" 5 #include "net/quic/quic_spdy_stream.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "net/quic/quic_connection.h" 10 #include "net/quic/quic_connection.h"
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 string trailers = SpdyUtils::SerializeUncompressedHeaders(trailers_block); 840 string trailers = SpdyUtils::SerializeUncompressedHeaders(trailers_block);
841 stream_->OnStreamHeaders(trailers); 841 stream_->OnStreamHeaders(trailers);
842 stream_->OnStreamHeadersComplete(/*fin=*/true, trailers.size()); 842 stream_->OnStreamHeadersComplete(/*fin=*/true, trailers.size());
843 843
844 // The trailers should be decompressed, and readable from the stream. 844 // The trailers should be decompressed, and readable from the stream.
845 EXPECT_TRUE(stream_->trailers_decompressed()); 845 EXPECT_TRUE(stream_->trailers_decompressed());
846 const string decompressed_trailers = stream_->decompressed_trailers(); 846 const string decompressed_trailers = stream_->decompressed_trailers();
847 EXPECT_EQ(trailers, decompressed_trailers); 847 EXPECT_EQ(trailers, decompressed_trailers);
848 // Consuming the trailers erases them from the stream. 848 // Consuming the trailers erases them from the stream.
849 stream_->MarkTrailersConsumed(decompressed_trailers.size()); 849 stream_->MarkTrailersConsumed(decompressed_trailers.size());
850 stream_->MarkTrailersDelivered();
850 EXPECT_EQ("", stream_->decompressed_trailers()); 851 EXPECT_EQ("", stream_->decompressed_trailers());
851 852
852 EXPECT_FALSE(stream_->IsDoneReading()); 853 EXPECT_FALSE(stream_->IsDoneReading());
853 // Receive and consume body. 854 // Receive and consume body.
854 QuicStreamFrame frame(kClientDataStreamId1, /*fin=*/false, 0, body); 855 QuicStreamFrame frame(kClientDataStreamId1, /*fin=*/false, 0, body);
855 stream_->OnStreamFrame(frame); 856 stream_->OnStreamFrame(frame);
856 EXPECT_EQ(body, stream_->data()); 857 EXPECT_EQ(body, stream_->data());
857 EXPECT_TRUE(stream_->IsDoneReading()); 858 EXPECT_TRUE(stream_->IsDoneReading());
858 } 859 }
859 860
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
991 992
992 // Writing Trailers should fail, as the FIN has already been sent. 993 // Writing Trailers should fail, as the FIN has already been sent.
993 // populated with the number of body bytes written. 994 // populated with the number of body bytes written.
994 EXPECT_DFATAL(stream_->WriteTrailers(SpdyHeaderBlock(), nullptr), 995 EXPECT_DFATAL(stream_->WriteTrailers(SpdyHeaderBlock(), nullptr),
995 "Trailers cannot be sent after a FIN"); 996 "Trailers cannot be sent after a FIN");
996 } 997 }
997 998
998 } // namespace 999 } // namespace
999 } // namespace test 1000 } // namespace test
1000 } // namespace net 1001 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_spdy_stream.cc ('k') | net/quic/spdy_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698