| 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 #include "content/browser/renderer_host/p2p/socket_host_tcp.h" | 5 #include "content/browser/renderer_host/p2p/socket_host_tcp.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 } | 31 } |
| 32 | 32 |
| 33 void SetUp() override { | 33 void SetUp() override { |
| 34 EXPECT_CALL( | 34 EXPECT_CALL( |
| 35 sender_, | 35 sender_, |
| 36 Send(MatchMessage(static_cast<uint32_t>(P2PMsg_OnSocketCreated::ID)))) | 36 Send(MatchMessage(static_cast<uint32_t>(P2PMsg_OnSocketCreated::ID)))) |
| 37 .WillOnce(DoAll(DeleteArg<0>(), Return(true))); | 37 .WillOnce(DoAll(DeleteArg<0>(), Return(true))); |
| 38 | 38 |
| 39 if (socket_type_ == P2P_SOCKET_TCP_CLIENT) { | 39 if (socket_type_ == P2P_SOCKET_TCP_CLIENT) { |
| 40 socket_host_.reset( | 40 socket_host_.reset( |
| 41 new P2PSocketHostTcp(&sender_, 0, P2P_SOCKET_TCP_CLIENT, NULL)); | 41 new P2PSocketHostTcp(&sender_, 0, P2P_SOCKET_TCP_CLIENT, nullptr)); |
| 42 } else { | 42 } else { |
| 43 socket_host_.reset(new P2PSocketHostStunTcp( | 43 socket_host_.reset(new P2PSocketHostStunTcp( |
| 44 &sender_, 0, P2P_SOCKET_STUN_TCP_CLIENT, NULL)); | 44 &sender_, 0, P2P_SOCKET_STUN_TCP_CLIENT, nullptr)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 socket_ = new FakeSocket(&sent_data_); | 47 socket_ = new FakeSocket(&sent_data_); |
| 48 socket_->SetLocalAddress(ParseAddress(kTestLocalIpAddress, kTestPort1)); | 48 socket_->SetLocalAddress(ParseAddress(kTestLocalIpAddress, kTestPort1)); |
| 49 socket_host_->socket_.reset(socket_); | 49 socket_host_->socket_.reset(socket_); |
| 50 | 50 |
| 51 dest_.ip_address = ParseAddress(kTestIpAddress1, kTestPort1); | 51 dest_.ip_address = ParseAddress(kTestIpAddress1, kTestPort1); |
| 52 | 52 |
| 53 local_address_ = ParseAddress(kTestLocalIpAddress, kTestPort1); | 53 local_address_ = ParseAddress(kTestLocalIpAddress, kTestPort1); |
| 54 | 54 |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 base::RunLoop().RunUntilIdle(); | 396 base::RunLoop().RunUntilIdle(); |
| 397 | 397 |
| 398 std::string expected_data; | 398 std::string expected_data; |
| 399 expected_data.append(packet1.begin(), packet1.end()); | 399 expected_data.append(packet1.begin(), packet1.end()); |
| 400 expected_data.append(packet2.begin(), packet2.end()); | 400 expected_data.append(packet2.begin(), packet2.end()); |
| 401 | 401 |
| 402 EXPECT_EQ(expected_data, sent_data_); | 402 EXPECT_EQ(expected_data, sent_data_); |
| 403 } | 403 } |
| 404 | 404 |
| 405 } // namespace content | 405 } // namespace content |
| OLD | NEW |