| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef NET_TOOLS_FLIP_SERVER_FLIP_TEST_UTILS_H_ | 5 #ifndef NET_TOOLS_FLIP_SERVER_FLIP_TEST_UTILS_H_ |
| 6 #define NET_TOOLS_FLIP_SERVER_FLIP_TEST_UTILS_H_ | 6 #define NET_TOOLS_FLIP_SERVER_FLIP_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "net/tools/flip_server/sm_interface.h" | 10 #include "net/tools/flip_server/sm_interface.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 | 15 |
| 16 class MockSMInterface : public SMInterface { | 16 class MockSMInterface : public SMInterface { |
| 17 public: | 17 public: |
| 18 MockSMInterface(); | 18 MockSMInterface(); |
| 19 virtual ~MockSMInterface(); | 19 virtual ~MockSMInterface(); |
| 20 | 20 |
| 21 MOCK_METHOD2(InitSMInterface, void(SMInterface*, int32)); | 21 MOCK_METHOD2(InitSMInterface, void(SMInterface*, int32)); |
| 22 MOCK_METHOD8(InitSMConnection, void(SMConnectionPoolInterface*, | 22 MOCK_METHOD8(InitSMConnection, |
| 23 SMInterface*, | 23 void(SMConnectionPoolInterface*, |
| 24 EpollServer*, | 24 SMInterface*, |
| 25 int, | 25 EpollServer*, |
| 26 std::string, | 26 int, |
| 27 std::string, | 27 std::string, |
| 28 std::string, | 28 std::string, |
| 29 bool)); | 29 std::string, |
| 30 bool)); |
| 30 MOCK_METHOD2(ProcessReadInput, size_t(const char*, size_t)); | 31 MOCK_METHOD2(ProcessReadInput, size_t(const char*, size_t)); |
| 31 MOCK_METHOD2(ProcessWriteInput, size_t(const char*, size_t)); | 32 MOCK_METHOD2(ProcessWriteInput, size_t(const char*, size_t)); |
| 32 MOCK_METHOD1(SetStreamID, void(uint32 stream_id)); | 33 MOCK_METHOD1(SetStreamID, void(uint32 stream_id)); |
| 33 MOCK_CONST_METHOD0(MessageFullyRead, bool()); | 34 MOCK_CONST_METHOD0(MessageFullyRead, bool()); |
| 34 MOCK_CONST_METHOD0(Error, bool()); | 35 MOCK_CONST_METHOD0(Error, bool()); |
| 35 MOCK_CONST_METHOD0(ErrorAsString, const char*()); | 36 MOCK_CONST_METHOD0(ErrorAsString, const char*()); |
| 36 MOCK_METHOD0(Reset, void()); | 37 MOCK_METHOD0(Reset, void()); |
| 37 MOCK_METHOD1(ResetForNewInterface, void(int32 server_idx)); | 38 MOCK_METHOD1(ResetForNewInterface, void(int32 server_idx)); |
| 38 MOCK_METHOD0(ResetForNewConnection, void()); | 39 MOCK_METHOD0(ResetForNewConnection, void()); |
| 39 MOCK_METHOD0(Cleanup, void()); | 40 MOCK_METHOD0(Cleanup, void()); |
| 40 MOCK_METHOD0(PostAcceptHook, int()); | 41 MOCK_METHOD0(PostAcceptHook, int()); |
| 41 MOCK_METHOD3(NewStream, void(uint32, uint32, const std::string&)); | 42 MOCK_METHOD3(NewStream, void(uint32, uint32, const std::string&)); |
| 42 MOCK_METHOD1(SendEOF, void(uint32 stream_id)); | 43 MOCK_METHOD1(SendEOF, void(uint32 stream_id)); |
| 43 MOCK_METHOD1(SendErrorNotFound, void(uint32 stream_id)); | 44 MOCK_METHOD1(SendErrorNotFound, void(uint32 stream_id)); |
| 44 MOCK_METHOD2(SendSynStream, size_t(uint32, const BalsaHeaders&)); | 45 MOCK_METHOD2(SendSynStream, size_t(uint32, const BalsaHeaders&)); |
| 45 MOCK_METHOD2(SendSynReply, size_t(uint32, const BalsaHeaders&)); | 46 MOCK_METHOD2(SendSynReply, size_t(uint32, const BalsaHeaders&)); |
| 46 MOCK_METHOD5(SendDataFrame, void(uint32, const char*, int64, uint32, bool)); | 47 MOCK_METHOD5(SendDataFrame, void(uint32, const char*, int64, uint32, bool)); |
| 47 MOCK_METHOD0(GetOutput, void()); | 48 MOCK_METHOD0(GetOutput, void()); |
| 48 MOCK_METHOD0(set_is_request, void()); | 49 MOCK_METHOD0(set_is_request, void()); |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 } // namespace net | 52 } // namespace net |
| 52 | 53 |
| 53 #endif // NET_TOOLS_FLIP_SERVER_FLIP_TEST_UTILS_H_ | 54 #endif // NET_TOOLS_FLIP_SERVER_FLIP_TEST_UTILS_H_ |
| OLD | NEW |