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

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

Issue 185203003: Killing off QUICv12, including cleaning out all of the code for handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Deleted unused StripUint32 Created 6 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_protocol_test.cc ('k') | net/quic/quic_session.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_reliable_client_stream.h" 5 #include "net/quic/quic_reliable_client_stream.h"
6 6
7 #include "net/base/net_errors.h" 7 #include "net/base/net_errors.h"
8 #include "net/base/test_completion_callback.h" 8 #include "net/base/test_completion_callback.h"
9 #include "net/quic/quic_client_session.h" 9 #include "net/quic/quic_client_session.h"
10 #include "net/quic/quic_utils.h" 10 #include "net/quic/quic_utils.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 INSTANTIATE_TEST_CASE_P(Version, QuicReliableClientStreamTest, 88 INSTANTIATE_TEST_CASE_P(Version, QuicReliableClientStreamTest,
89 ::testing::ValuesIn(QuicSupportedVersions())); 89 ::testing::ValuesIn(QuicSupportedVersions()));
90 90
91 TEST_P(QuicReliableClientStreamTest, OnFinRead) { 91 TEST_P(QuicReliableClientStreamTest, OnFinRead) {
92 InitializeHeaders(); 92 InitializeHeaders();
93 string uncompressed_headers = 93 string uncompressed_headers =
94 SpdyUtils::SerializeUncompressedHeaders(headers_); 94 SpdyUtils::SerializeUncompressedHeaders(headers_);
95 EXPECT_CALL(delegate_, OnDataReceived(StrEq(uncompressed_headers.data()), 95 EXPECT_CALL(delegate_, OnDataReceived(StrEq(uncompressed_headers.data()),
96 uncompressed_headers.size())); 96 uncompressed_headers.size()));
97 QuicStreamOffset offset = 0; 97 QuicStreamOffset offset = 0;
98 if (GetParam() > QUIC_VERSION_12) { 98 stream_->OnStreamHeaders(uncompressed_headers);
99 stream_->OnStreamHeaders(uncompressed_headers); 99 stream_->OnStreamHeadersComplete(false, uncompressed_headers.length());
100 stream_->OnStreamHeadersComplete(false, uncompressed_headers.length());
101 } else {
102 QuicSpdyCompressor compressor;
103 string compressed_headers = compressor.CompressHeaders(headers_);
104 QuicStreamFrame frame1(kStreamId, false, 0,
105 MakeIOVector(compressed_headers));
106 stream_->OnStreamFrame(frame1);
107 offset = compressed_headers.length();
108 }
109 100
110 IOVector iov; 101 IOVector iov;
111 QuicStreamFrame frame2(kStreamId, true, offset, iov); 102 QuicStreamFrame frame2(kStreamId, true, offset, iov);
112 EXPECT_CALL(delegate_, OnClose(QUIC_NO_ERROR)); 103 EXPECT_CALL(delegate_, OnClose(QUIC_NO_ERROR));
113 stream_->OnStreamFrame(frame2); 104 stream_->OnStreamFrame(frame2);
114 } 105 }
115 106
116 TEST_P(QuicReliableClientStreamTest, ProcessData) { 107 TEST_P(QuicReliableClientStreamTest, ProcessData) {
117 const char data[] = "hello world!"; 108 const char data[] = "hello world!";
118 EXPECT_CALL(delegate_, OnDataReceived(StrEq(data), arraysize(data))); 109 EXPECT_CALL(delegate_, OnDataReceived(StrEq(data), arraysize(data)));
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 EXPECT_CALL(session_, WritevData(stream_->id(), _, _, _, _)).WillOnce( 164 EXPECT_CALL(session_, WritevData(stream_->id(), _, _, _, _)).WillOnce(
174 Return(QuicConsumedData(kDataLen, true))); 165 Return(QuicConsumedData(kDataLen, true)));
175 stream_->OnCanWrite(); 166 stream_->OnCanWrite();
176 ASSERT_TRUE(callback.have_result()); 167 ASSERT_TRUE(callback.have_result());
177 EXPECT_EQ(OK, callback.WaitForResult()); 168 EXPECT_EQ(OK, callback.WaitForResult());
178 } 169 }
179 170
180 } // namespace 171 } // namespace
181 } // namespace test 172 } // namespace test
182 } // namespace net 173 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_protocol_test.cc ('k') | net/quic/quic_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698