| 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_reliable_client_stream.h" | 5 #include "net/quic/quic_reliable_client_stream.h" |
| 6 | 6 |
| 7 #include "net/base/net_errors.h" | 7 #include "net/base/net_errors.h" |
| 8 #include "net/base/test_completion_callback.h" | 8 #include "net/base/test_completion_callback.h" |
| 9 #include "net/quic/quic_client_session.h" | 9 #include "net/quic/quic_client_session.h" |
| 10 #include "net/quic/quic_utils.h" | 10 #include "net/quic/quic_utils.h" |
| 11 #include "net/quic/spdy_utils.h" | 11 #include "net/quic/spdy_utils.h" |
| 12 #include "net/quic/test_tools/quic_test_utils.h" | 12 #include "net/quic/test_tools/quic_test_utils.h" |
| 13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
| 14 | 14 |
| 15 using testing::AnyNumber; | 15 using testing::AnyNumber; |
| 16 using testing::Return; | 16 using testing::Return; |
| 17 using testing::StrEq; | 17 using testing::StrEq; |
| 18 using testing::_; | 18 using testing::_; |
| 19 | 19 |
| 20 namespace net { | 20 namespace net { |
| 21 namespace test { | 21 namespace test { |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 const QuicGuid kStreamId = 3; | 24 const QuicConnectionId kStreamId = 3; |
| 25 | 25 |
| 26 class MockDelegate : public QuicReliableClientStream::Delegate { | 26 class MockDelegate : public QuicReliableClientStream::Delegate { |
| 27 public: | 27 public: |
| 28 MockDelegate() {} | 28 MockDelegate() {} |
| 29 | 29 |
| 30 MOCK_METHOD0(OnSendData, int()); | 30 MOCK_METHOD0(OnSendData, int()); |
| 31 MOCK_METHOD2(OnSendDataComplete, int(int, bool*)); | 31 MOCK_METHOD2(OnSendDataComplete, int(int, bool*)); |
| 32 MOCK_METHOD2(OnDataReceived, int(const char*, int)); | 32 MOCK_METHOD2(OnDataReceived, int(const char*, int)); |
| 33 MOCK_METHOD1(OnClose, void(QuicErrorCode)); | 33 MOCK_METHOD1(OnClose, void(QuicErrorCode)); |
| 34 MOCK_METHOD1(OnError, void(int)); | 34 MOCK_METHOD1(OnError, void(int)); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 EXPECT_CALL(session_, WritevData(stream_->id(), _, _, _, _)).WillOnce( | 173 EXPECT_CALL(session_, WritevData(stream_->id(), _, _, _, _)).WillOnce( |
| 174 Return(QuicConsumedData(kDataLen, true))); | 174 Return(QuicConsumedData(kDataLen, true))); |
| 175 stream_->OnCanWrite(); | 175 stream_->OnCanWrite(); |
| 176 ASSERT_TRUE(callback.have_result()); | 176 ASSERT_TRUE(callback.have_result()); |
| 177 EXPECT_EQ(OK, callback.WaitForResult()); | 177 EXPECT_EQ(OK, callback.WaitForResult()); |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace | 180 } // namespace |
| 181 } // namespace test | 181 } // namespace test |
| 182 } // namespace net | 182 } // namespace net |
| OLD | NEW |