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

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

Issue 2391103003: Landing Recent QUIC changes until 3:24 PM, Oct 01, 2016 UTC-4 (Closed)
Patch Set: Add new error code to quic_error_mapping.cc 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 unified diff | Download patch
« no previous file with comments | « net/quic/core/quic_spdy_stream.cc ('k') | net/quic/core/quic_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/core/quic_spdy_stream.h" 5 #include "net/quic/core/quic_spdy_stream.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 string trailers = SpdyUtils::SerializeUncompressedHeaders(trailers_block); 833 string trailers = SpdyUtils::SerializeUncompressedHeaders(trailers_block);
834 stream_->OnStreamHeaders(trailers); 834 stream_->OnStreamHeaders(trailers);
835 stream_->OnStreamHeadersComplete(/*fin=*/true, trailers.size()); 835 stream_->OnStreamHeadersComplete(/*fin=*/true, trailers.size());
836 836
837 // The trailers should be decompressed, and readable from the stream. 837 // The trailers should be decompressed, and readable from the stream.
838 EXPECT_TRUE(stream_->trailers_decompressed()); 838 EXPECT_TRUE(stream_->trailers_decompressed());
839 const string decompressed_trailers = stream_->decompressed_trailers(); 839 const string decompressed_trailers = stream_->decompressed_trailers();
840 EXPECT_EQ(trailers, decompressed_trailers); 840 EXPECT_EQ(trailers, decompressed_trailers);
841 // Consuming the trailers erases them from the stream. 841 // Consuming the trailers erases them from the stream.
842 stream_->MarkTrailersConsumed(decompressed_trailers.size()); 842 stream_->MarkTrailersConsumed(decompressed_trailers.size());
843 stream_->MarkTrailersDelivered(); 843 stream_->MarkTrailersConsumed();
844 EXPECT_EQ("", stream_->decompressed_trailers()); 844 EXPECT_EQ("", stream_->decompressed_trailers());
845 845
846 EXPECT_FALSE(stream_->IsDoneReading()); 846 EXPECT_FALSE(stream_->IsDoneReading());
847 // Receive and consume body. 847 // Receive and consume body.
848 QuicStreamFrame frame(kClientDataStreamId1, /*fin=*/false, 0, body); 848 QuicStreamFrame frame(kClientDataStreamId1, /*fin=*/false, 0, body);
849 stream_->OnStreamFrame(frame); 849 stream_->OnStreamFrame(frame);
850 EXPECT_EQ(body, stream_->data()); 850 EXPECT_EQ(body, stream_->data());
851 EXPECT_TRUE(stream_->IsDoneReading()); 851 EXPECT_TRUE(stream_->IsDoneReading());
852 } 852 }
853 853
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 992
993 // Writing Trailers should fail, as the FIN has already been sent. 993 // Writing Trailers should fail, as the FIN has already been sent.
994 // populated with the number of body bytes written. 994 // populated with the number of body bytes written.
995 EXPECT_QUIC_BUG(stream_->WriteTrailers(SpdyHeaderBlock(), nullptr), 995 EXPECT_QUIC_BUG(stream_->WriteTrailers(SpdyHeaderBlock(), nullptr),
996 "Trailers cannot be sent after a FIN"); 996 "Trailers cannot be sent after a FIN");
997 } 997 }
998 998
999 } // namespace 999 } // namespace
1000 } // namespace test 1000 } // namespace test
1001 } // namespace net 1001 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_spdy_stream.cc ('k') | net/quic/core/quic_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698