Chromium Code Reviews| 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/chromium/quic_http_stream.h" | 5 #include "net/quic/chromium/quic_http_stream.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1523 request_.url = GURL("https://www.example.org/"); | 1523 request_.url = GURL("https://www.example.org/"); |
| 1524 request_.upload_data_stream = upload_data_stream_.get(); | 1524 request_.upload_data_stream = upload_data_stream_.get(); |
| 1525 ASSERT_EQ(OK, request_.upload_data_stream->Init( | 1525 ASSERT_EQ(OK, request_.upload_data_stream->Init( |
| 1526 TestCompletionCallback().callback(), NetLogWithSource())); | 1526 TestCompletionCallback().callback(), NetLogWithSource())); |
| 1527 | 1527 |
| 1528 ASSERT_EQ(OK, | 1528 ASSERT_EQ(OK, |
| 1529 stream_->InitializeStream(&request_, DEFAULT_PRIORITY, | 1529 stream_->InitializeStream(&request_, DEFAULT_PRIORITY, |
| 1530 net_log_.bound(), callback_.callback())); | 1530 net_log_.bound(), callback_.callback())); |
| 1531 ASSERT_EQ(ERR_QUIC_PROTOCOL_ERROR, | 1531 ASSERT_EQ(ERR_QUIC_PROTOCOL_ERROR, |
| 1532 stream_->SendRequest(headers_, &response_, callback_.callback())); | 1532 stream_->SendRequest(headers_, &response_, callback_.callback())); |
| 1533 | |
| 1534 EXPECT_LE(0, stream_->GetTotalSentBytes()); | |
|
mmenke
2017/06/14 21:20:41
Speaking of which...We don't have any async versio
mmenke
2017/06/14 21:20:41
This could be EQ, since the writes are synchronous
Zhongyi Shi
2017/06/15 17:32:19
I think you're right. It might be covered implicit
| |
| 1535 EXPECT_EQ(0, stream_->GetTotalReceivedBytes()); | |
| 1533 } | 1536 } |
| 1534 | 1537 |
| 1535 TEST_P(QuicHttpStreamTest, SessionClosedBeforeSendBodyComplete) { | 1538 TEST_P(QuicHttpStreamTest, SessionClosedBeforeSendBodyComplete) { |
| 1536 SetRequest("POST", "/", DEFAULT_PRIORITY); | 1539 SetRequest("POST", "/", DEFAULT_PRIORITY); |
| 1537 size_t spdy_request_headers_frame_length; | 1540 size_t spdy_request_headers_frame_length; |
| 1538 QuicStreamOffset header_stream_offset = 0; | 1541 QuicStreamOffset header_stream_offset = 0; |
| 1539 AddWrite(ConstructInitialSettingsPacket(&header_stream_offset)); | 1542 AddWrite(ConstructInitialSettingsPacket(&header_stream_offset)); |
| 1540 AddWrite(InnerConstructRequestHeadersPacket( | 1543 AddWrite(InnerConstructRequestHeadersPacket( |
| 1541 2, GetNthClientInitiatedStreamId(0), kIncludeVersion, !kFin, | 1544 2, GetNthClientInitiatedStreamId(0), kIncludeVersion, !kFin, |
| 1542 DEFAULT_PRIORITY, &spdy_request_headers_frame_length, | 1545 DEFAULT_PRIORITY, &spdy_request_headers_frame_length, |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2111 EXPECT_TRUE(AtEof()); | 2114 EXPECT_TRUE(AtEof()); |
| 2112 | 2115 |
| 2113 // QuicHttpStream::GetTotalSent/ReceivedBytes includes only headers. | 2116 // QuicHttpStream::GetTotalSent/ReceivedBytes includes only headers. |
| 2114 EXPECT_EQ(static_cast<int64_t>(spdy_request_headers_frame_length), | 2117 EXPECT_EQ(static_cast<int64_t>(spdy_request_headers_frame_length), |
| 2115 stream_->GetTotalSentBytes()); | 2118 stream_->GetTotalSentBytes()); |
| 2116 EXPECT_EQ(0, stream_->GetTotalReceivedBytes()); | 2119 EXPECT_EQ(0, stream_->GetTotalReceivedBytes()); |
| 2117 } | 2120 } |
| 2118 | 2121 |
| 2119 } // namespace test | 2122 } // namespace test |
| 2120 } // namespace net | 2123 } // namespace net |
| OLD | NEW |