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/quic/core/quic_headers_stream.h" | 5 #include "net/quic/core/quic_headers_stream.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "net/quic/core/quic_bug_tracker.h" | 10 #include "net/quic/core/quic_bug_tracker.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 switch (hpack_decoder) { | 201 switch (hpack_decoder) { |
202 case HPACK_DECODER_SPDY: | 202 case HPACK_DECODER_SPDY: |
203 FLAGS_spdy_use_hpack_decoder2 = false; | 203 FLAGS_spdy_use_hpack_decoder2 = false; |
204 break; | 204 break; |
205 case HPACK_DECODER_NEW: | 205 case HPACK_DECODER_NEW: |
206 FLAGS_spdy_use_hpack_decoder2 = true; | 206 FLAGS_spdy_use_hpack_decoder2 = true; |
207 // Needs new header methods to be used. | 207 // Needs new header methods to be used. |
208 FLAGS_spdy_framer_use_new_methods3 = true; | 208 FLAGS_spdy_framer_use_new_methods3 = true; |
209 break; | 209 break; |
210 } | 210 } |
211 FLAGS_quic_always_log_bugs_for_tests = true; | |
212 VLOG(1) << "TestParams: version: " << QuicVersionToString(version) | 211 VLOG(1) << "TestParams: version: " << QuicVersionToString(version) |
213 << ", perspective: " << perspective | 212 << ", perspective: " << perspective |
214 << ", http2_decoder: " << http2_decoder | 213 << ", http2_decoder: " << http2_decoder |
215 << ", hpack_decoder: " << hpack_decoder; | 214 << ", hpack_decoder: " << hpack_decoder; |
216 } | 215 } |
217 | 216 |
218 QuicVersion version; | 217 QuicVersion version; |
219 Perspective perspective; | 218 Perspective perspective; |
220 Http2DecoderChoice http2_decoder; | 219 Http2DecoderChoice http2_decoder; |
221 HpackDecoderChoice hpack_decoder; | 220 HpackDecoderChoice hpack_decoder; |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 headers_handler_.reset(new TestHeadersHandler); | 452 headers_handler_.reset(new TestHeadersHandler); |
454 EXPECT_CALL(visitor_, OnHeaderFrameStart(stream_id)) | 453 EXPECT_CALL(visitor_, OnHeaderFrameStart(stream_id)) |
455 .WillOnce(Return(headers_handler_.get())); | 454 .WillOnce(Return(headers_handler_.get())); |
456 EXPECT_CALL(visitor_, OnHeaderFrameEnd(stream_id, true)).Times(1); | 455 EXPECT_CALL(visitor_, OnHeaderFrameEnd(stream_id, true)).Times(1); |
457 framer_->ProcessInput(saved_data_.data(), saved_data_.length()); | 456 framer_->ProcessInput(saved_data_.data(), saved_data_.length()); |
458 EXPECT_FALSE(framer_->HasError()) | 457 EXPECT_FALSE(framer_->HasError()) |
459 << SpdyFramer::ErrorCodeToString(framer_->error_code()); | 458 << SpdyFramer::ErrorCodeToString(framer_->error_code()); |
460 CheckHeaders(); | 459 CheckHeaders(); |
461 saved_data_.clear(); | 460 saved_data_.clear(); |
462 } else { | 461 } else { |
463 EXPECT_DFATAL( | 462 EXPECT_QUIC_BUG( |
464 headers_stream_->WritePushPromise(stream_id, promised_stream_id, | 463 headers_stream_->WritePushPromise(stream_id, promised_stream_id, |
465 headers_.Clone(), nullptr), | 464 headers_.Clone(), nullptr), |
466 "Client shouldn't send PUSH_PROMISE"); | 465 "Client shouldn't send PUSH_PROMISE"); |
467 } | 466 } |
468 } | 467 } |
469 } | 468 } |
470 | 469 |
471 TEST_P(QuicHeadersStreamTest, ProcessRawData) { | 470 TEST_P(QuicHeadersStreamTest, ProcessRawData) { |
472 for (QuicStreamId stream_id = kClientDataStreamId1; | 471 for (QuicStreamId stream_id = kClientDataStreamId1; |
473 stream_id < kClientDataStreamId3; stream_id += 2) { | 472 stream_id < kClientDataStreamId3; stream_id += 2) { |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 } | 963 } |
965 saved_data_.clear(); | 964 saved_data_.clear(); |
966 saved_payloads_.clear(); | 965 saved_payloads_.clear(); |
967 } | 966 } |
968 } | 967 } |
969 } | 968 } |
970 | 969 |
971 } // namespace | 970 } // namespace |
972 } // namespace test | 971 } // namespace test |
973 } // namespace net | 972 } // namespace net |
OLD | NEW |