Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(670)

Side by Side Diff: content/browser/renderer_host/p2p/socket_host_test_utils.h

Issue 7715020: Move P2P code to content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <vector> 8 #include <vector>
9 9
10 #include "content/common/p2p_messages.h" 10 #include "content/common/p2p_messages.h"
11 #include "ipc/ipc_message.h" 11 #include "ipc/ipc_message.h"
12 #include "ipc/ipc_message_utils.h" 12 #include "ipc/ipc_message_utils.h"
13 #include "net/base/address_list.h" 13 #include "net/base/address_list.h"
14 #include "net/base/completion_callback.h" 14 #include "net/base/completion_callback.h"
15 #include "net/base/io_buffer.h" 15 #include "net/base/io_buffer.h"
16 #include "net/base/net_errors.h" 16 #include "net/base/net_errors.h"
17 #include "net/base/sys_byteorder.h" 17 #include "net/base/sys_byteorder.h"
18 #include "net/socket/stream_socket.h" 18 #include "net/socket/stream_socket.h"
19 #include "testing/gmock/include/gmock/gmock.h" 19 #include "testing/gmock/include/gmock/gmock.h"
20 #include "testing/gtest/include/gtest/gtest.h" 20 #include "testing/gtest/include/gtest/gtest.h"
21 21
22 namespace content {
23
22 namespace { 24 namespace {
jam 2011/08/24 00:24:27 ditto
Sergey Ulanov 2011/08/24 01:57:48 Done.
23 25
24 const char kTestLocalIpAddress[] = "123.44.22.4"; 26 const char kTestLocalIpAddress[] = "123.44.22.4";
25 const char kTestIpAddress1[] = "123.44.22.31"; 27 const char kTestIpAddress1[] = "123.44.22.31";
26 const int kTestPort1 = 234; 28 const int kTestPort1 = 234;
27 const char kTestIpAddress2[] = "133.11.22.33"; 29 const char kTestIpAddress2[] = "133.11.22.33";
28 const int kTestPort2 = 543; 30 const int kTestPort2 = 543;
29 31
30 const int kStunHeaderSize = 20; 32 const int kStunHeaderSize = 20;
31 const uint16 kStunBindingRequest = 0x0001; 33 const uint16 kStunBindingRequest = 0x0001;
32 const uint16 kStunBindingResponse = 0x0102; 34 const uint16 kStunBindingResponse = 0x0102;
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 if (arg->type() != P2PMsg_OnIncomingTcpConnection::ID) 274 if (arg->type() != P2PMsg_OnIncomingTcpConnection::ID)
273 return false; 275 return false;
274 P2PMsg_OnIncomingTcpConnection::Param params; 276 P2PMsg_OnIncomingTcpConnection::Param params;
275 IPC::MessageWithTuple<P2PMsg_OnIncomingTcpConnection::Param>::Read( 277 IPC::MessageWithTuple<P2PMsg_OnIncomingTcpConnection::Param>::Read(
276 arg, &params); 278 arg, &params);
277 return params.b == address; 279 return params.b == address;
278 } 280 }
279 281
280 } // namespace 282 } // namespace
281 283
284 } // namespace content
285
282 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ 286 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698