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 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1709 TestCompletionCallback cb; | 1709 TestCompletionCallback cb; |
1710 int rv = delegate->ReadData(cb.callback()); | 1710 int rv = delegate->ReadData(cb.callback()); |
1711 EXPECT_THAT(rv, IsError(ERR_IO_PENDING)); | 1711 EXPECT_THAT(rv, IsError(ERR_IO_PENDING)); |
1712 session()->connection()->CloseConnection( | 1712 session()->connection()->CloseConnection( |
1713 QUIC_NO_ERROR, "test", ConnectionCloseBehavior::SILENT_CLOSE); | 1713 QUIC_NO_ERROR, "test", ConnectionCloseBehavior::SILENT_CLOSE); |
1714 delegate->WaitUntilNextCallback(kOnFailed); | 1714 delegate->WaitUntilNextCallback(kOnFailed); |
1715 | 1715 |
1716 // Try to send data after OnFailed(), should not get called back. | 1716 // Try to send data after OnFailed(), should not get called back. |
1717 scoped_refptr<StringIOBuffer> buf(new StringIOBuffer(kUploadData)); | 1717 scoped_refptr<StringIOBuffer> buf(new StringIOBuffer(kUploadData)); |
1718 delegate->SendData(buf, buf->size(), false); | 1718 delegate->SendData(buf, buf->size(), false); |
1719 base::RunLoop().RunUntilIdle(); | |
1720 | 1719 |
1721 EXPECT_THAT(delegate->ReadData(cb.callback()), IsError(ERR_UNEXPECTED)); | 1720 EXPECT_THAT(delegate->ReadData(cb.callback()), |
1722 EXPECT_THAT(delegate->error(), IsError(ERR_UNEXPECTED)); | 1721 IsError(ERR_QUIC_PROTOCOL_ERROR)); |
| 1722 EXPECT_THAT(delegate->error(), IsError(ERR_QUIC_PROTOCOL_ERROR)); |
1723 EXPECT_EQ(0, delegate->on_data_read_count()); | 1723 EXPECT_EQ(0, delegate->on_data_read_count()); |
1724 EXPECT_EQ(0, delegate->on_data_sent_count()); | 1724 EXPECT_EQ(0, delegate->on_data_sent_count()); |
1725 EXPECT_EQ(kProtoQUIC, delegate->GetProtocol()); | 1725 EXPECT_EQ(kProtoQUIC, delegate->GetProtocol()); |
1726 EXPECT_EQ(static_cast<int64_t>(spdy_request_headers_frame_length), | 1726 EXPECT_EQ(static_cast<int64_t>(spdy_request_headers_frame_length), |
1727 delegate->GetTotalSentBytes()); | 1727 delegate->GetTotalSentBytes()); |
1728 EXPECT_EQ(static_cast<int64_t>(spdy_response_headers_frame_length), | 1728 EXPECT_EQ(static_cast<int64_t>(spdy_response_headers_frame_length), |
1729 delegate->GetTotalReceivedBytes()); | 1729 delegate->GetTotalReceivedBytes()); |
1730 } | 1730 } |
1731 | 1731 |
1732 TEST_P(BidirectionalStreamQuicImplTest, SessionClosedBeforeStartConfirmed) { | 1732 TEST_P(BidirectionalStreamQuicImplTest, SessionClosedBeforeStartConfirmed) { |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2116 | 2116 |
2117 base::RunLoop().RunUntilIdle(); | 2117 base::RunLoop().RunUntilIdle(); |
2118 | 2118 |
2119 EXPECT_EQ(1, delegate->on_data_read_count()); | 2119 EXPECT_EQ(1, delegate->on_data_read_count()); |
2120 EXPECT_EQ(0, delegate->on_data_sent_count()); | 2120 EXPECT_EQ(0, delegate->on_data_sent_count()); |
2121 } | 2121 } |
2122 | 2122 |
2123 } // namespace test | 2123 } // namespace test |
2124 | 2124 |
2125 } // namespace net | 2125 } // namespace net |
OLD | NEW |