OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_server_stream.h" | 5 #include "net/tools/quic/quic_spdy_server_stream.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "base/strings/string_piece.h" | 8 #include "base/strings/string_piece.h" |
9 #include "net/quic/quic_connection.h" | 9 #include "net/quic/quic_connection.h" |
10 #include "net/quic/quic_protocol.h" | 10 #include "net/quic/quic_protocol.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 const uint32 kInitialWindow = 10 * kMaxPacketSize; | 87 const uint32 kInitialWindow = 10 * kMaxPacketSize; |
88 session_.config()->SetInitialFlowControlWindowToSend( | 88 session_.config()->SetInitialFlowControlWindowToSend( |
89 kInitialWindow); | 89 kInitialWindow); |
90 stream_.reset(new QuicSpdyServerStreamPeer(3, &session_)); | 90 stream_.reset(new QuicSpdyServerStreamPeer(3, &session_)); |
91 } | 91 } |
92 | 92 |
93 static void SetUpTestCase() { | 93 static void SetUpTestCase() { |
94 QuicInMemoryCachePeer::ResetForTests(); | 94 QuicInMemoryCachePeer::ResetForTests(); |
95 } | 95 } |
96 | 96 |
97 virtual void SetUp() { | 97 virtual void SetUp() OVERRIDE { |
98 QuicInMemoryCache* cache = QuicInMemoryCache::GetInstance(); | 98 QuicInMemoryCache* cache = QuicInMemoryCache::GetInstance(); |
99 | 99 |
100 BalsaHeaders request_headers, response_headers; | 100 BalsaHeaders request_headers, response_headers; |
101 StringPiece body("Yum"); | 101 StringPiece body("Yum"); |
102 request_headers.SetRequestFirstlineFromStringPieces( | 102 request_headers.SetRequestFirstlineFromStringPieces( |
103 "GET", | 103 "GET", |
104 "https://www.google.com/foo", | 104 "https://www.google.com/foo", |
105 "HTTP/1.1"); | 105 "HTTP/1.1"); |
106 response_headers.SetRequestFirstlineFromStringPieces("HTTP/1.1", | 106 response_headers.SetRequestFirstlineFromStringPieces("HTTP/1.1", |
107 "200", | 107 "200", |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 StringPiece data(arr, arraysize(arr)); | 265 StringPiece data(arr, arraysize(arr)); |
266 QuicStreamFrame frame(stream_->id(), true, 0, MakeIOVector(data)); | 266 QuicStreamFrame frame(stream_->id(), true, 0, MakeIOVector(data)); |
267 // Verify that we don't crash when we get a invalid headers in stream frame. | 267 // Verify that we don't crash when we get a invalid headers in stream frame. |
268 stream_->OnStreamFrame(frame); | 268 stream_->OnStreamFrame(frame); |
269 } | 269 } |
270 | 270 |
271 } // namespace | 271 } // namespace |
272 } // namespace test | 272 } // namespace test |
273 } // namespace tools | 273 } // namespace tools |
274 } // namespace net | 274 } // namespace net |
OLD | NEW |