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

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

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 years, 10 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
« no previous file with comments | « net/dns/address_sorter_posix_unittest.cc ('k') | net/ftp/ftp_directory_listing_parser.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 <resolv.h> 5 #include <resolv.h>
6 6
7 #include "base/sys_byteorder.h" 7 #include "base/sys_byteorder.h"
8 #include "net/dns/dns_config_service_posix.h" 8 #include "net/dns/dns_config_service_posix.h"
9 9
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 #if !defined(OS_ANDROID) 12 #if !defined(OS_ANDROID)
13 13
14 namespace net { 14 namespace net {
15 namespace { 15 namespace {
16 16
17 // MAXNS is normally 3, but let's test 4 if possible. 17 // MAXNS is normally 3, but let's test 4 if possible.
18 const char* kNameserversIPv4[] = { 18 const char* const kNameserversIPv4[] = {
19 "8.8.8.8", 19 "8.8.8.8",
20 "192.168.1.1", 20 "192.168.1.1",
21 "63.1.2.4", 21 "63.1.2.4",
22 "1.0.0.1", 22 "1.0.0.1",
23 }; 23 };
24 24
25 #if defined(OS_LINUX) 25 #if defined(OS_LINUX)
26 const char* kNameserversIPv6[] = { 26 const char* const kNameserversIPv6[] = {
27 NULL, 27 NULL,
28 "2001:DB8:0::42", 28 "2001:DB8:0::42",
29 NULL, 29 NULL,
30 "::FFFF:129.144.52.38", 30 "::FFFF:129.144.52.38",
31 }; 31 };
32 #endif 32 #endif
33 33
34 // Fills in |res| with sane configuration. 34 // Fills in |res| with sane configuration.
35 void InitializeResState(res_state res) { 35 void InitializeResState(res_state res) {
36 memset(res, 0, sizeof(*res)); 36 memset(res, 0, sizeof(*res));
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 sa.sin_addr.s_addr = 0xDEADBEEF; 151 sa.sin_addr.s_addr = 0xDEADBEEF;
152 res.nsaddr_list[0] = sa; 152 res.nsaddr_list[0] = sa;
153 EXPECT_EQ(internal::CONFIG_PARSE_POSIX_OK, 153 EXPECT_EQ(internal::CONFIG_PARSE_POSIX_OK,
154 internal::ConvertResStateToDnsConfig(res, &config)); 154 internal::ConvertResStateToDnsConfig(res, &config));
155 } 155 }
156 156
157 } // namespace 157 } // namespace
158 } // namespace net 158 } // namespace net
159 159
160 #endif // !OS_ANDROID 160 #endif // !OS_ANDROID
OLDNEW
« no previous file with comments | « net/dns/address_sorter_posix_unittest.cc ('k') | net/ftp/ftp_directory_listing_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698