OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "mojo/public/cpp/bindings/callback.h" | |
9 #include "mojo/services/network/public/cpp/udp_socket_wrapper.h" | 8 #include "mojo/services/network/public/cpp/udp_socket_wrapper.h" |
10 #include "mojo/services/network/public/interfaces/network_service.mojom.h" | 9 #include "mojo/services/network/public/interfaces/network_service.mojom.h" |
11 #include "mojo/services/network/public/interfaces/udp_socket.mojom.h" | 10 #include "mojo/services/network/public/interfaces/udp_socket.mojom.h" |
12 #include "mojo/shell/shell_test_helper.h" | 11 #include "mojo/shell/shell_test_helper.h" |
13 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "mojo/public/cpp/bindings/callback.h" |
15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
16 | 16 |
17 namespace mojo { | 17 namespace mojo { |
18 namespace service { | 18 namespace service { |
19 namespace { | 19 namespace { |
20 | 20 |
21 NetAddressPtr GetLocalHostWithAnyPort() { | 21 NetAddressPtr GetLocalHostWithAnyPort() { |
22 NetAddressPtr addr(NetAddress::New()); | 22 NetAddressPtr addr(NetAddress::New()); |
23 addr->family = NET_ADDRESS_FAMILY_IPV4; | 23 addr->family = NET_ADDRESS_FAMILY_IPV4; |
24 addr->ipv4 = NetAddressIPv4::New(); | 24 addr->ipv4 = NetAddressIPv4::New(); |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 receive_callbacks[j].result()->code); | 449 receive_callbacks[j].result()->code); |
450 EXPECT_TRUE(receive_callbacks[j].src_addr().Equals(client_addr)); | 450 EXPECT_TRUE(receive_callbacks[j].src_addr().Equals(client_addr)); |
451 EXPECT_TRUE(receive_callbacks[j].data().Equals( | 451 EXPECT_TRUE(receive_callbacks[j].data().Equals( |
452 CreateTestMessage(static_cast<uint8_t>(j), kDatagramSize))); | 452 CreateTestMessage(static_cast<uint8_t>(j), kDatagramSize))); |
453 } | 453 } |
454 } | 454 } |
455 } | 455 } |
456 | 456 |
457 } // namespace service | 457 } // namespace service |
458 } // namespace mojo | 458 } // namespace mojo |
OLD | NEW |