OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/bidirectional_stream_quic_impl.h" | 5 #include "net/quic/chromium/bidirectional_stream_quic_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1591 session()->connection()->CloseConnection( | 1591 session()->connection()->CloseConnection( |
1592 QUIC_NO_ERROR, "test", ConnectionCloseBehavior::SILENT_CLOSE); | 1592 QUIC_NO_ERROR, "test", ConnectionCloseBehavior::SILENT_CLOSE); |
1593 delegate->WaitUntilNextCallback(); // OnFailed | 1593 delegate->WaitUntilNextCallback(); // OnFailed |
1594 EXPECT_TRUE(delegate->on_failed_called()); | 1594 EXPECT_TRUE(delegate->on_failed_called()); |
1595 | 1595 |
1596 // Try to send data after OnFailed(), should not get called back. | 1596 // Try to send data after OnFailed(), should not get called back. |
1597 scoped_refptr<StringIOBuffer> buf(new StringIOBuffer(kUploadData)); | 1597 scoped_refptr<StringIOBuffer> buf(new StringIOBuffer(kUploadData)); |
1598 delegate->SendData(buf, buf->size(), false); | 1598 delegate->SendData(buf, buf->size(), false); |
1599 base::RunLoop().RunUntilIdle(); | 1599 base::RunLoop().RunUntilIdle(); |
1600 | 1600 |
1601 EXPECT_THAT(delegate->ReadData(cb.callback()), IsError(ERR_UNEXPECTED)); | 1601 EXPECT_THAT(delegate->ReadData(cb.callback()), |
1602 EXPECT_THAT(delegate->error(), IsError(ERR_UNEXPECTED)); | 1602 IsError(ERR_QUIC_PROTOCOL_ERROR)); |
| 1603 EXPECT_THAT(delegate->error(), IsError(ERR_QUIC_PROTOCOL_ERROR)); |
1603 EXPECT_EQ(0, delegate->on_data_read_count()); | 1604 EXPECT_EQ(0, delegate->on_data_read_count()); |
1604 EXPECT_EQ(0, delegate->on_data_sent_count()); | 1605 EXPECT_EQ(0, delegate->on_data_sent_count()); |
1605 EXPECT_EQ(kProtoQUIC, delegate->GetProtocol()); | 1606 EXPECT_EQ(kProtoQUIC, delegate->GetProtocol()); |
1606 EXPECT_EQ(static_cast<int64_t>(spdy_request_headers_frame_length), | 1607 EXPECT_EQ(static_cast<int64_t>(spdy_request_headers_frame_length), |
1607 delegate->GetTotalSentBytes()); | 1608 delegate->GetTotalSentBytes()); |
1608 EXPECT_EQ(static_cast<int64_t>(spdy_response_headers_frame_length), | 1609 EXPECT_EQ(static_cast<int64_t>(spdy_response_headers_frame_length), |
1609 delegate->GetTotalReceivedBytes()); | 1610 delegate->GetTotalReceivedBytes()); |
1610 } | 1611 } |
1611 | 1612 |
1612 TEST_P(BidirectionalStreamQuicImplTest, DeleteStreamAfterReadData) { | 1613 TEST_P(BidirectionalStreamQuicImplTest, DeleteStreamAfterReadData) { |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1896 | 1897 |
1897 base::RunLoop().RunUntilIdle(); | 1898 base::RunLoop().RunUntilIdle(); |
1898 | 1899 |
1899 EXPECT_EQ(1, delegate->on_data_read_count()); | 1900 EXPECT_EQ(1, delegate->on_data_read_count()); |
1900 EXPECT_EQ(0, delegate->on_data_sent_count()); | 1901 EXPECT_EQ(0, delegate->on_data_sent_count()); |
1901 } | 1902 } |
1902 | 1903 |
1903 } // namespace test | 1904 } // namespace test |
1904 | 1905 |
1905 } // namespace net | 1906 } // namespace net |
OLD | NEW |