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

Side by Side Diff: net/tools/quic/quic_spdy_client_stream_test.cc

Issue 2740453006: Add QuicStringPiece which is actually StringPiece. (Closed)
Patch Set: fix compile error and rebase Created 3 years, 9 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
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/tools/quic/quic_spdy_client_stream.h" 5 #include "net/tools/quic/quic_spdy_client_stream.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "net/quic/core/quic_utils.h" 10 #include "net/quic/core/quic_utils.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 stream_->OnStreamFrame( 149 stream_->OnStreamFrame(
150 QuicStreamFrame(stream_->id(), /*fin=*/false, /*offset=*/0, large_body)); 150 QuicStreamFrame(stream_->id(), /*fin=*/false, /*offset=*/0, large_body));
151 151
152 EXPECT_NE(QUIC_STREAM_NO_ERROR, stream_->stream_error()); 152 EXPECT_NE(QUIC_STREAM_NO_ERROR, stream_->stream_error());
153 } 153 }
154 154
155 TEST_F(QuicSpdyClientStreamTest, TestNoBidirectionalStreaming) { 155 TEST_F(QuicSpdyClientStreamTest, TestNoBidirectionalStreaming) {
156 if (FLAGS_quic_reloadable_flag_quic_always_enable_bidi_streaming) { 156 if (FLAGS_quic_reloadable_flag_quic_always_enable_bidi_streaming) {
157 return; 157 return;
158 } 158 }
159 QuicStreamFrame frame(kClientDataStreamId1, false, 3, StringPiece("asd")); 159 QuicStreamFrame frame(kClientDataStreamId1, false, 3, QuicStringPiece("asd"));
160 160
161 EXPECT_FALSE(stream_->write_side_closed()); 161 EXPECT_FALSE(stream_->write_side_closed());
162 stream_->OnStreamFrame(frame); 162 stream_->OnStreamFrame(frame);
163 EXPECT_TRUE(stream_->write_side_closed()); 163 EXPECT_TRUE(stream_->write_side_closed());
164 } 164 }
165 165
166 TEST_F(QuicSpdyClientStreamTest, ReceivingTrailers) { 166 TEST_F(QuicSpdyClientStreamTest, ReceivingTrailers) {
167 // Test that receiving trailing headers, containing a final offset, results in 167 // Test that receiving trailing headers, containing a final offset, results in
168 // the stream being closed at that byte offset. 168 // the stream being closed at that byte offset.
169 // Send headers as usual. 169 // Send headers as usual.
(...skipping 20 matching lines...) Expand all
190 stream_->OnStreamFrame( 190 stream_->OnStreamFrame(
191 QuicStreamFrame(stream_->id(), /*fin=*/false, /*offset=*/0, body_)); 191 QuicStreamFrame(stream_->id(), /*fin=*/false, /*offset=*/0, body_));
192 if (FLAGS_quic_reloadable_flag_quic_always_enable_bidi_streaming) { 192 if (FLAGS_quic_reloadable_flag_quic_always_enable_bidi_streaming) {
193 EXPECT_TRUE(stream_->reading_stopped()); 193 EXPECT_TRUE(stream_->reading_stopped());
194 } 194 }
195 } 195 }
196 196
197 } // namespace 197 } // namespace
198 } // namespace test 198 } // namespace test
199 } // namespace net 199 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_spdy_client_stream.cc ('k') | net/tools/quic/quic_time_wait_list_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698