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/reliable_quic_stream.h" | 5 #include "net/quic/reliable_quic_stream.h" |
6 | 6 |
7 #include "net/quic/quic_connection.h" | 7 #include "net/quic/quic_connection.h" |
8 #include "net/quic/quic_utils.h" | 8 #include "net/quic/quic_utils.h" |
9 #include "net/quic/test_tools/quic_test_utils.h" | 9 #include "net/quic/test_tools/quic_test_utils.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE { | 31 virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE { |
32 return 0; | 32 return 0; |
33 } | 33 } |
34 using ReliableQuicStream::WriteData; | 34 using ReliableQuicStream::WriteData; |
35 }; | 35 }; |
36 | 36 |
37 class ReliableQuicStreamTest : public ::testing::TestWithParam<bool> { | 37 class ReliableQuicStreamTest : public ::testing::TestWithParam<bool> { |
38 public: | 38 public: |
39 ReliableQuicStreamTest() | 39 ReliableQuicStreamTest() |
40 : connection_(new MockConnection(1, IPEndPoint())), | 40 : connection_(new MockConnection(1, IPEndPoint(), false)), |
41 session_(connection_, true), | 41 session_(connection_, true), |
42 stream_(1, &session_) { | 42 stream_(1, &session_) { |
43 } | 43 } |
44 | 44 |
45 MockConnection* connection_; | 45 MockConnection* connection_; |
46 MockSession session_; | 46 MockSession session_; |
47 QuicReliableTestStream stream_; | 47 QuicReliableTestStream stream_; |
48 }; | 48 }; |
49 | 49 |
50 TEST_F(ReliableQuicStreamTest, WriteAllData) { | 50 TEST_F(ReliableQuicStreamTest, WriteAllData) { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // And finally the end of the bytes_consumed | 83 // And finally the end of the bytes_consumed |
84 //EXPECT_CALL(session_, WriteData(_, StrEq(&kData2[kDataLen - 2]), _, _)). | 84 //EXPECT_CALL(session_, WriteData(_, StrEq(&kData2[kDataLen - 2]), _, _)). |
85 EXPECT_CALL(session_, WriteData(_, _, _, _)). | 85 EXPECT_CALL(session_, WriteData(_, _, _, _)). |
86 WillOnce(Return(QuicConsumedData(2, true))); | 86 WillOnce(Return(QuicConsumedData(2, true))); |
87 stream_.OnCanWrite(); | 87 stream_.OnCanWrite(); |
88 } | 88 } |
89 | 89 |
90 } // namespace | 90 } // namespace |
91 } // namespace test | 91 } // namespace test |
92 } // namespace net | 92 } // namespace net |
OLD | NEW |