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 <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 Loading... |
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 |
OLD | NEW |