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