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

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

Issue 1997863002: Revert of Avoids the "re-encode HPACK as SPDY3" step. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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();
851 EXPECT_EQ("", stream_->decompressed_trailers()); 850 EXPECT_EQ("", stream_->decompressed_trailers());
852 851
853 EXPECT_FALSE(stream_->IsDoneReading()); 852 EXPECT_FALSE(stream_->IsDoneReading());
854 // Receive and consume body. 853 // Receive and consume body.
855 QuicStreamFrame frame(kClientDataStreamId1, /*fin=*/false, 0, body); 854 QuicStreamFrame frame(kClientDataStreamId1, /*fin=*/false, 0, body);
856 stream_->OnStreamFrame(frame); 855 stream_->OnStreamFrame(frame);
857 EXPECT_EQ(body, stream_->data()); 856 EXPECT_EQ(body, stream_->data());
858 EXPECT_TRUE(stream_->IsDoneReading()); 857 EXPECT_TRUE(stream_->IsDoneReading());
859 } 858 }
860 859
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 991
993 // Writing Trailers should fail, as the FIN has already been sent. 992 // Writing Trailers should fail, as the FIN has already been sent.
994 // populated with the number of body bytes written. 993 // populated with the number of body bytes written.
995 EXPECT_DFATAL(stream_->WriteTrailers(SpdyHeaderBlock(), nullptr), 994 EXPECT_DFATAL(stream_->WriteTrailers(SpdyHeaderBlock(), nullptr),
996 "Trailers cannot be sent after a FIN"); 995 "Trailers cannot be sent after a FIN");
997 } 996 }
998 997
999 } // namespace 998 } // namespace
1000 } // namespace test 999 } // namespace test
1001 } // namespace net 1000 } // 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