OLD | NEW |
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_http_stream.h" | 5 #include "net/quic/quic_http_stream.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
10 #include "net/base/test_completion_callback.h" | 10 #include "net/base/test_completion_callback.h" |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 stream_->ReadResponseBody(read_buffer_.get(), read_buffer_->size(), | 521 stream_->ReadResponseBody(read_buffer_.get(), read_buffer_->size(), |
522 callback_.callback())); | 522 callback_.callback())); |
523 | 523 |
524 EXPECT_TRUE(stream_->IsResponseBodyComplete()); | 524 EXPECT_TRUE(stream_->IsResponseBodyComplete()); |
525 EXPECT_TRUE(AtEof()); | 525 EXPECT_TRUE(AtEof()); |
526 } | 526 } |
527 | 527 |
528 TEST_F(QuicHttpStreamTest, DestroyedEarly) { | 528 TEST_F(QuicHttpStreamTest, DestroyedEarly) { |
529 SetRequestString("GET", "/"); | 529 SetRequestString("GET", "/"); |
530 AddWrite(SYNCHRONOUS, ConstructDataPacket(1, true, kFin, 0, request_data_)); | 530 AddWrite(SYNCHRONOUS, ConstructDataPacket(1, true, kFin, 0, request_data_)); |
531 AddWrite(SYNCHRONOUS, ConstructAckPacket(2, 2, 1)); | 531 AddWrite(SYNCHRONOUS, ConstructRstPacket(2, 3)); |
| 532 AddWrite(SYNCHRONOUS, ConstructAckPacket(3, 2, 1)); |
532 use_closing_stream_ = true; | 533 use_closing_stream_ = true; |
533 Initialize(); | 534 Initialize(); |
534 | 535 |
535 request_.method = "GET"; | 536 request_.method = "GET"; |
536 request_.url = GURL("http://www.google.com/"); | 537 request_.url = GURL("http://www.google.com/"); |
537 | 538 |
538 EXPECT_EQ(OK, stream_->InitializeStream(&request_, DEFAULT_PRIORITY, | 539 EXPECT_EQ(OK, stream_->InitializeStream(&request_, DEFAULT_PRIORITY, |
539 net_log_, callback_.callback())); | 540 net_log_, callback_.callback())); |
540 EXPECT_EQ(OK, stream_->SendRequest(headers_, &response_, | 541 EXPECT_EQ(OK, stream_->SendRequest(headers_, &response_, |
541 callback_.callback())); | 542 callback_.callback())); |
(...skipping 12 matching lines...) Expand all Loading... |
554 | 555 |
555 // In the course of processing this packet, the QuicHttpStream close itself. | 556 // In the course of processing this packet, the QuicHttpStream close itself. |
556 ProcessPacket(*resp); | 557 ProcessPacket(*resp); |
557 | 558 |
558 EXPECT_TRUE(AtEof()); | 559 EXPECT_TRUE(AtEof()); |
559 } | 560 } |
560 | 561 |
561 } // namespace test | 562 } // namespace test |
562 | 563 |
563 } // namespace net | 564 } // namespace net |
OLD | NEW |