| 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 "chromeos/network/host_resolver_impl_chromeos.h" | 5 #include "chromeos/network/host_resolver_impl_chromeos.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 dbus::ObjectPath(default_device_path), shill::kIPConfigsProperty, | 120 dbus::ObjectPath(default_device_path), shill::kIPConfigsProperty, |
| 121 ip_configs, base::Bind(&base::DoNothing), | 121 ip_configs, base::Bind(&base::DoNothing), |
| 122 base::Bind(&ErrorCallbackFunction)); | 122 base::Bind(&ErrorCallbackFunction)); |
| 123 base::RunLoop().RunUntilIdle(); | 123 base::RunLoop().RunUntilIdle(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void SetIPConfig(const std::string& path, | 126 void SetIPConfig(const std::string& path, |
| 127 const std::string& method, | 127 const std::string& method, |
| 128 const std::string& address) { | 128 const std::string& address) { |
| 129 DBusThreadManager::Get()->GetShillIPConfigClient()->SetProperty( | 129 DBusThreadManager::Get()->GetShillIPConfigClient()->SetProperty( |
| 130 dbus::ObjectPath(path), shill::kAddressProperty, | 130 dbus::ObjectPath(path), shill::kAddressProperty, base::Value(address), |
| 131 base::StringValue(address), base::Bind(&DoNothingWithCallStatus)); | 131 base::Bind(&DoNothingWithCallStatus)); |
| 132 DBusThreadManager::Get()->GetShillIPConfigClient()->SetProperty( | 132 DBusThreadManager::Get()->GetShillIPConfigClient()->SetProperty( |
| 133 dbus::ObjectPath(path), shill::kMethodProperty, | 133 dbus::ObjectPath(path), shill::kMethodProperty, base::Value(method), |
| 134 base::StringValue(method), base::Bind(&DoNothingWithCallStatus)); | 134 base::Bind(&DoNothingWithCallStatus)); |
| 135 } | 135 } |
| 136 | 136 |
| 137 std::unique_ptr<NetworkStateHandler> network_state_handler_; | 137 std::unique_ptr<NetworkStateHandler> network_state_handler_; |
| 138 std::unique_ptr<net::HostResolver> host_resolver_; | 138 std::unique_ptr<net::HostResolver> host_resolver_; |
| 139 base::MessageLoop io_message_loop_; | 139 base::MessageLoop io_message_loop_; |
| 140 net::NetLogWithSource net_log_; | 140 net::NetLogWithSource net_log_; |
| 141 std::unique_ptr<net::HostResolver::Request> request_; | 141 std::unique_ptr<net::HostResolver::Request> request_; |
| 142 | 142 |
| 143 DISALLOW_COPY_AND_ASSIGN(HostResolverImplChromeOSTest); | 143 DISALLOW_COPY_AND_ASSIGN(HostResolverImplChromeOSTest); |
| 144 }; | 144 }; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 156 info.set_address_family(net::ADDRESS_FAMILY_IPV6); | 156 info.set_address_family(net::ADDRESS_FAMILY_IPV6); |
| 157 EXPECT_EQ(net::OK, CallResolve(info)); | 157 EXPECT_EQ(net::OK, CallResolve(info)); |
| 158 ASSERT_EQ(2u, addresses_.size()); | 158 ASSERT_EQ(2u, addresses_.size()); |
| 159 expected = base::StringPrintf("[%s]:%d", kTestIPv6Address, 0); | 159 expected = base::StringPrintf("[%s]:%d", kTestIPv6Address, 0); |
| 160 EXPECT_EQ(expected, addresses_[0].ToString()); | 160 EXPECT_EQ(expected, addresses_[0].ToString()); |
| 161 expected = base::StringPrintf("%s:%d", kTestIPv4Address, 0); | 161 expected = base::StringPrintf("%s:%d", kTestIPv4Address, 0); |
| 162 EXPECT_EQ(expected, addresses_[1].ToString()); | 162 EXPECT_EQ(expected, addresses_[1].ToString()); |
| 163 } | 163 } |
| 164 | 164 |
| 165 } // namespace chromeos | 165 } // namespace chromeos |
| OLD | NEW |