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

Side by Side Diff: net/dns/dns_config_service_win_unittest.cc

Issue 10309002: Reimplements net::AddressList without struct addrinfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: get_canonical_name -> canonical_name. iterator to indexing Created 8 years, 7 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
« no previous file with comments | « net/dns/dns_config_service.h ('k') | net/dns/dns_response_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "net/dns/dns_config_service_win.h" 5 #include "net/dns/dns_config_service_win.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/win/windows_version.h" 8 #include "base/win/windows_version.h"
9 #include "net/dns/dns_protocol.h" 9 #include "net/dns/dns_protocol.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 address = adapter->FirstDnsServerAddress = addresses + num_addresses; 97 address = adapter->FirstDnsServerAddress = addresses + num_addresses;
98 } else { 98 } else {
99 // Note that |address| is moving backwards. 99 // Note that |address| is moving backwards.
100 address = address->Next = address - 1; 100 address = address->Next = address - 1;
101 } 101 }
102 IPAddressNumber ip; 102 IPAddressNumber ip;
103 CHECK(ParseIPLiteralToNumber(info.dns_server_addresses[j], &ip)); 103 CHECK(ParseIPLiteralToNumber(info.dns_server_addresses[j], &ip));
104 IPEndPoint ipe(ip, info.ports[j]); 104 IPEndPoint ipe(ip, info.ports[j]);
105 address->Address.lpSockaddr = 105 address->Address.lpSockaddr =
106 reinterpret_cast<LPSOCKADDR>(storage + num_addresses); 106 reinterpret_cast<LPSOCKADDR>(storage + num_addresses);
107 size_t length = sizeof(struct sockaddr_storage); 107 socklen_t length = sizeof(struct sockaddr_storage);
108 CHECK(ipe.ToSockAddr(address->Address.lpSockaddr, &length)); 108 CHECK(ipe.ToSockAddr(address->Address.lpSockaddr, &length));
109 address->Address.iSockaddrLength = static_cast<int>(length); 109 address->Address.iSockaddrLength = static_cast<int>(length);
110 } 110 }
111 } 111 }
112 112
113 return heap.Pass(); 113 return heap.Pass();
114 } 114 }
115 115
116 TEST(DnsConfigServiceWinTest, ConvertAdapterAddresses) { 116 TEST(DnsConfigServiceWinTest, ConvertAdapterAddresses) {
117 // Check nameservers and connection-specific suffix. 117 // Check nameservers and connection-specific suffix.
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 DnsConfig config; 416 DnsConfig config;
417 ASSERT_TRUE(internal::ConvertSettingsToDnsConfig(settings, &config)); 417 ASSERT_TRUE(internal::ConvertSettingsToDnsConfig(settings, &config));
418 EXPECT_EQ(config.append_to_multi_label_name, t.expected_output); 418 EXPECT_EQ(config.append_to_multi_label_name, t.expected_output);
419 } 419 }
420 } 420 }
421 421
422 } // namespace 422 } // namespace
423 423
424 } // namespace net 424 } // namespace net
425 425
OLDNEW
« no previous file with comments | « net/dns/dns_config_service.h ('k') | net/dns/dns_response_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698