OLD | NEW |
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 #include "content/browser/renderer_host/p2p/socket_host_udp.h" | 5 #include "content/browser/renderer_host/p2p/socket_host_udp.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
| 10 #include "base/sys_byteorder.h" |
10 #include "content/browser/renderer_host/p2p/socket_host_test_utils.h" | 11 #include "content/browser/renderer_host/p2p/socket_host_test_utils.h" |
11 #include "net/base/io_buffer.h" | 12 #include "net/base/io_buffer.h" |
12 #include "net/base/ip_endpoint.h" | 13 #include "net/base/ip_endpoint.h" |
13 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
14 #include "net/base/sys_byteorder.h" | |
15 #include "net/udp/datagram_server_socket.h" | 15 #include "net/udp/datagram_server_socket.h" |
16 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 using ::testing::_; | 19 using ::testing::_; |
20 using ::testing::DeleteArg; | 20 using ::testing::DeleteArg; |
21 using ::testing::DoAll; | 21 using ::testing::DoAll; |
22 using ::testing::Return; | 22 using ::testing::Return; |
23 | 23 |
24 namespace { | 24 namespace { |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 // Should fail when trying to send the same packet to |dest2_|. | 241 // Should fail when trying to send the same packet to |dest2_|. |
242 std::vector<char> packet; | 242 std::vector<char> packet; |
243 CreateRandomPacket(&packet); | 243 CreateRandomPacket(&packet); |
244 EXPECT_CALL(sender_, Send( | 244 EXPECT_CALL(sender_, Send( |
245 MatchMessage(static_cast<uint32>(P2PMsg_OnError::ID)))) | 245 MatchMessage(static_cast<uint32>(P2PMsg_OnError::ID)))) |
246 .WillOnce(DoAll(DeleteArg<0>(), Return(true))); | 246 .WillOnce(DoAll(DeleteArg<0>(), Return(true))); |
247 socket_host_->Send(dest2_, packet); | 247 socket_host_->Send(dest2_, packet); |
248 } | 248 } |
249 | 249 |
250 } // namespace content | 250 } // namespace content |
OLD | NEW |