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 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <string> |
10 #include <tuple> | 11 #include <tuple> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 #include "content/common/p2p_messages.h" | 14 #include "content/common/p2p_messages.h" |
14 #include "ipc/ipc_sender.h" | 15 #include "ipc/ipc_sender.h" |
15 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
| 17 #include "net/log/net_log_with_source.h" |
16 #include "net/socket/stream_socket.h" | 18 #include "net/socket/stream_socket.h" |
17 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
19 | 21 |
20 const char kTestLocalIpAddress[] = "123.44.22.4"; | 22 const char kTestLocalIpAddress[] = "123.44.22.4"; |
21 const char kTestIpAddress1[] = "123.44.22.31"; | 23 const char kTestIpAddress1[] = "123.44.22.31"; |
22 const uint16_t kTestPort1 = 234; | 24 const uint16_t kTestPort1 = 234; |
23 const char kTestIpAddress2[] = "133.11.22.33"; | 25 const char kTestIpAddress2[] = "133.11.22.33"; |
24 const uint16_t kTestPort2 = 543; | 26 const uint16_t kTestPort2 = 543; |
25 | 27 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 MATCHER_P(MatchIncomingSocketMessage, address, "") { | 117 MATCHER_P(MatchIncomingSocketMessage, address, "") { |
116 if (arg->type() != P2PMsg_OnIncomingTcpConnection::ID) | 118 if (arg->type() != P2PMsg_OnIncomingTcpConnection::ID) |
117 return false; | 119 return false; |
118 P2PMsg_OnIncomingTcpConnection::Param params; | 120 P2PMsg_OnIncomingTcpConnection::Param params; |
119 P2PMsg_OnIncomingTcpConnection::Read( | 121 P2PMsg_OnIncomingTcpConnection::Read( |
120 arg, ¶ms); | 122 arg, ¶ms); |
121 return std::get<1>(params) == address; | 123 return std::get<1>(params) == address; |
122 } | 124 } |
123 | 125 |
124 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ | 126 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ |
OLD | NEW |