OLD | NEW |
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/spdy/spdy_stream.h" | 5 #include "net/spdy/spdy_stream.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <cstddef> | 9 #include <cstddef> |
10 #include <limits> | 10 #include <limits> |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 // Delegate that receives trailers. | 219 // Delegate that receives trailers. |
220 class StreamDelegateWithTrailers : public test::StreamDelegateWithBody { | 220 class StreamDelegateWithTrailers : public test::StreamDelegateWithBody { |
221 public: | 221 public: |
222 StreamDelegateWithTrailers(const base::WeakPtr<SpdyStream>& stream, | 222 StreamDelegateWithTrailers(const base::WeakPtr<SpdyStream>& stream, |
223 base::StringPiece data) | 223 base::StringPiece data) |
224 : StreamDelegateWithBody(stream, data) {} | 224 : StreamDelegateWithBody(stream, data) {} |
225 | 225 |
226 ~StreamDelegateWithTrailers() override {} | 226 ~StreamDelegateWithTrailers() override {} |
227 | 227 |
228 void OnTrailers(const SpdyHeaderBlock& trailers) override { | 228 void OnTrailers(const SpdyHeaderBlock& trailers) override { |
229 trailers_ = trailers; | 229 trailers_ = trailers.Clone(); |
230 } | 230 } |
231 | 231 |
232 const SpdyHeaderBlock& trailers() const { return trailers_; } | 232 const SpdyHeaderBlock& trailers() const { return trailers_; } |
233 | 233 |
234 private: | 234 private: |
235 SpdyHeaderBlock trailers_; | 235 SpdyHeaderBlock trailers_; |
236 }; | 236 }; |
237 | 237 |
238 // Regression test for crbug.com/481033. | 238 // Regression test for crbug.com/481033. |
239 TEST_P(SpdyStreamTest, Trailers) { | 239 TEST_P(SpdyStreamTest, Trailers) { |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 EXPECT_EQ(response_len, stream->raw_received_bytes()); | 1150 EXPECT_EQ(response_len, stream->raw_received_bytes()); |
1151 | 1151 |
1152 // FIN | 1152 // FIN |
1153 data.Resume(); | 1153 data.Resume(); |
1154 EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate.WaitForClose()); | 1154 EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate.WaitForClose()); |
1155 } | 1155 } |
1156 | 1156 |
1157 } // namespace test | 1157 } // namespace test |
1158 | 1158 |
1159 } // namespace net | 1159 } // namespace net |
OLD | NEW |