blob: f36bf682ffdeaf69da34a4f9e18465dde4e3a9a3 [file] [log] [blame]
Avi Drissman64595482022-09-14 20:52:291# Copyright 2018 The Chromium Authors
Eric Orth24feb5b2018-05-25 19:42:462# Use of this source code is governed by a BSD-style license that can be
Yngve N. Pettersend5a75172018-07-09 06:36:563# found in the LICENSE file.
Eric Orth24feb5b2018-05-25 19:42:464
Eric Orth24feb5b2018-05-25 19:42:465import("//net/features.gni")
Max Morozf5eeca02018-12-01 18:43:306import("//testing/libfuzzer/fuzzer_test.gni")
Dan McArdlea6116fd2021-09-23 17:21:527import("//third_party/protobuf/proto_library.gni")
Eric Orth24feb5b2018-05-25 19:42:468
Hyowon Kim34a0ef82023-02-24 06:05:579enable_built_in_dns = use_blink
Eric Orth24feb5b2018-05-25 19:42:4610
11source_set("dns") {
12 # Due to circular dependencies, should only be depended on through //net.
Takuto Ikuta94330d9b2019-03-09 11:03:1413 visibility = [
14 "//net",
15 "//net/http:transport_security_state_generated_files",
16 ]
Eric Orth24feb5b2018-05-25 19:42:4617
18 # Internals only intended for use inside network stack (and tests).
19 friend = [
20 "//chrome/browser:test_support",
21 "//chrome/test/*",
22 "//components/certificate_transparency:unit_tests",
23 "//components/cronet/*",
Matthew Dentona9b37702022-10-28 22:23:2024
25 # Needed for brokering system DNS resolution out of the network service.
26 "//content/browser/system_dns_resolution",
27 "//content/test/*",
Eric Orth24feb5b2018-05-25 19:42:4628 "//net/*",
29 "//services/network/*",
30 ]
31
32 public = []
33 sources = [
David Benjaminead319b2021-05-05 21:48:1734 "address_info.cc",
35 "address_info.h",
36 "address_sorter.h",
37 "context_host_resolver.cc",
38 "context_host_resolver.h",
39 "dns_alias_utility.cc",
40 "dns_alias_utility.h",
41 "dns_config.cc",
42 "dns_config_service.cc",
43 "dns_config_service.h",
44 "dns_hosts.cc",
45 "dns_hosts.h",
Eric Orth02c98932022-12-02 23:05:4646 "dns_names_util.cc",
47 "dns_names_util.h",
David Benjaminead319b2021-05-05 21:48:1748 "dns_query.cc",
49 "dns_query.h",
50 "dns_reloader.cc",
51 "dns_reloader.h",
52 "dns_response.cc",
53 "dns_response_result_extractor.cc",
54 "dns_response_result_extractor.h",
55 "dns_server_iterator.cc",
56 "dns_server_iterator.h",
57 "dns_session.cc",
58 "dns_session.h",
David Benjaminead319b2021-05-05 21:48:1759 "dns_transaction.cc",
60 "dns_udp_tracker.cc",
61 "dns_udp_tracker.h",
Eric Orth24feb5b2018-05-25 19:42:4662 "dns_util.cc",
63 "dns_util.h",
David Benjaminead319b2021-05-05 21:48:1764 "host_cache.cc",
65 "host_resolver.cc",
Eric Orthda551f02023-06-01 19:27:0566 "host_resolver_cache.cc",
67 "host_resolver_cache.h",
Eric Orthb6b2ead2022-11-01 16:50:3068 "host_resolver_internal_result.cc",
69 "host_resolver_internal_result.h",
David Benjaminead319b2021-05-05 21:48:1770 "host_resolver_manager.cc",
71 "host_resolver_mdns_listener_impl.cc",
72 "host_resolver_mdns_listener_impl.h",
73 "host_resolver_mdns_task.cc",
74 "host_resolver_mdns_task.h",
Momoka Yamamotof1accfce2022-10-13 10:00:1975 "host_resolver_nat64_task.cc",
76 "host_resolver_nat64_task.h",
David Benjaminead319b2021-05-05 21:48:1777 "host_resolver_proc.cc",
78 "host_resolver_proc.h",
Matthew Denton3eef9d7a2022-09-29 02:00:3379 "host_resolver_system_task.cc",
80 "host_resolver_system_task.h",
David Benjaminead319b2021-05-05 21:48:1781 "https_record_rdata.cc",
82 "httpssvc_metrics.cc",
83 "httpssvc_metrics.h",
Matthew Denton2862358f02023-05-31 10:16:0684 "loopback_only.cc",
85 "loopback_only.h",
David Benjaminead319b2021-05-05 21:48:1786 "mapped_host_resolver.cc",
87 "nsswitch_reader.cc",
88 "nsswitch_reader.h",
Sukrit Ganesh93883ff62022-07-29 18:13:2689 "opt_record_rdata.cc",
David Benjaminead319b2021-05-05 21:48:1790 "record_parsed.cc",
91 "record_rdata.cc",
92 "resolve_context.cc",
93 "resolve_context.h",
94 "serial_worker.cc",
95 "serial_worker.h",
96 "system_dns_config_change_notifier.cc",
97 "system_dns_config_change_notifier.h",
Dan McArdle00271b92022-02-11 23:41:1898 "test_dns_config_service.cc",
99 "test_dns_config_service.h",
Eric Orth24feb5b2018-05-25 19:42:46100 ]
101
David Benjaminead319b2021-05-05 21:48:17102 if (is_win) {
Eric Orth24feb5b2018-05-25 19:42:46103 sources += [
David Benjaminead319b2021-05-05 21:48:17104 "address_sorter_win.cc",
105 "dns_config_service_win.cc",
106 "dns_config_service_win.h",
Eric Orth24feb5b2018-05-25 19:42:46107 ]
David Benjaminead319b2021-05-05 21:48:17108 }
Eric Orth24feb5b2018-05-25 19:42:46109
David Benjaminead319b2021-05-05 21:48:17110 if (is_mac) {
111 sources += [
112 "dns_config_watcher_mac.cc",
113 "dns_config_watcher_mac.h",
114 "notify_watcher_mac.cc",
115 "notify_watcher_mac.h",
116 ]
117 }
118
119 if (is_fuchsia) {
120 sources += [
121 "dns_config_service_fuchsia.cc",
122 "dns_config_service_fuchsia.h",
123 ]
124 }
125
126 if (is_android) {
127 sources += [
128 "dns_config_service_android.cc",
129 "dns_config_service_android.h",
130 ]
131 } else if (is_linux) {
132 sources += [
133 "dns_config_service_linux.cc",
134 "dns_config_service_linux.h",
135 ]
136 } else if (is_posix) {
137 sources += [
138 "dns_config_service_posix.cc",
139 "dns_config_service_posix.h",
140 ]
141 }
142
143 if (enable_built_in_dns) {
144 sources += [ "dns_client.cc" ]
145
146 if (is_posix || is_fuchsia) {
Sylvain Defresne2a262082020-09-15 11:19:58147 sources += [
David Benjaminead319b2021-05-05 21:48:17148 "address_sorter_posix.cc",
149 "address_sorter_posix.h",
Sylvain Defresne2a262082020-09-15 11:19:58150 ]
151 }
David Benjaminead319b2021-05-05 21:48:17152 }
Sylvain Defresne2a262082020-09-15 11:19:58153
David Benjaminead319b2021-05-05 21:48:17154 if (enable_mdns) {
155 sources += [
156 "mdns_cache.cc",
157 "mdns_cache.h",
158 "mdns_client.cc",
159 "mdns_client_impl.cc",
160 "mdns_client_impl.h",
161 ]
Eric Orth24feb5b2018-05-25 19:42:46162 }
163
Nico Webera2afc7f2020-01-13 21:06:20164 deps = [ "//net:net_deps" ]
Eric Orth24feb5b2018-05-25 19:42:46165
166 public_deps = [
167 ":dns_client",
Eric Orth168a7e52018-08-27 19:11:32168 ":host_resolver",
Eric Orth0bea1662019-03-20 19:11:22169 ":host_resolver_manager",
Eric Orth24feb5b2018-05-25 19:42:46170 ":mdns_client",
Eric Orth24feb5b2018-05-25 19:42:46171 "//net:net_public_deps",
172 ]
173
174 allow_circular_includes_from = [
175 ":dns_client",
Eric Orth168a7e52018-08-27 19:11:32176 ":host_resolver",
Eric Orth0bea1662019-03-20 19:11:22177 ":host_resolver_manager",
Eric Orth24feb5b2018-05-25 19:42:46178 ":mdns_client",
Eric Orth24feb5b2018-05-25 19:42:46179 ]
180}
181
Eric Orth168a7e52018-08-27 19:11:32182# The standard API of net/dns.
183#
184# Should typically only be used within the network service. Usage external to
185# the network service should instead use network service Mojo IPCs for host
186# resolution. See ResolveHost() in
187# /services/network/public/mojom/network_context.mojom and
188# /services/network/public/mojom/host_resolver.mojom.
189source_set("host_resolver") {
Eric Orth24feb5b2018-05-25 19:42:46190 # Due to circular dependencies, should only be depended on through //net.
191 # Limit visibility to //net and other source_sets with the same access
192 # restriction.
193 visibility = [
194 ":dns",
dalykbd726ee2019-05-30 01:44:06195 ":dns_client",
Eric Orth0bea1662019-03-20 19:11:22196 ":host_resolver_manager",
Eric Orth24feb5b2018-05-25 19:42:46197 ":mdns_client",
198 "//net",
199 ]
200
Ryan Sleevia9d6aa62019-07-26 13:32:18201 # Restricted access so we can keep track of all usage external to the
Eric Orth168a7e52018-08-27 19:11:32202 # network stack and network service.
203 friend = [
Eric Orth168a7e52018-08-27 19:11:32204 # chromecast/browser/url_request_context_factory.cc
205 # URLRequestContext creation for chromecast.
206 "//chromecast/browser",
207
Eric Orth168a7e52018-08-27 19:11:32208 # URLRequestContext and HttpNetworkSession::Context creation for iOS.
209 "//ios/components/io_thread",
210 "//ios/web/shell",
211 "//ios/web_view:*",
212
213 # Tests and test support.
214 "//chrome/browser:test_support",
Kevin Marshalle51ba9a2022-02-07 19:50:14215 "//chrome/test/*",
Eric Orth168a7e52018-08-27 19:11:32216 "//components/grpc_support/test:unit_tests",
217 "//content/shell:content_shell_lib",
Matt Menke991dd7e2021-07-22 17:31:51218 "//content/test:*",
Eric Orth168a7e52018-08-27 19:11:32219
220 # Stand-alone tools.
Eric Orth168a7e52018-08-27 19:11:32221 "//google_apis/gcm:mcs_probe",
222
223 # Network stack/service.
224 "//components/certificate_transparency/*",
225 "//components/cronet/*",
226 "//net/*",
227 "//services/network/*",
228 ]
229
David Benjaminead319b2021-05-05 21:48:17230 sources = [
231 "dns_config.h",
232 "host_cache.h",
233 "host_resolver.h",
David Benjaminead319b2021-05-05 21:48:17234 "mapped_host_resolver.h",
235 ]
Eric Orth24feb5b2018-05-25 19:42:46236 public = []
237
Eric Orth24feb5b2018-05-25 19:42:46238 deps = [
239 "//net:net_deps",
Eric Orth192e3bb2018-11-14 19:30:32240 "//net/dns/public",
Eric Orth24feb5b2018-05-25 19:42:46241 ]
Nico Webera2afc7f2020-01-13 21:06:20242 public_deps = [ "//net:net_public_deps" ]
Eric Orth89bce392020-09-25 21:36:19243
244 allow_circular_includes_from = [ "//net/dns/public" ]
Eric Orth24feb5b2018-05-25 19:42:46245}
246
Eric Orth0bea1662019-03-20 19:11:22247# Shared mostly-global handler of HostResolver requests.
248#
249# Typically should only be directly interacted with by NetworkService (or other
250# mostly-global creators of request contexts), standalone tools, and tests. Host
251# resolution should generally instead go through HostResolvers received from
252# URLRequestContext or network service Mojo IPCs.
253source_set("host_resolver_manager") {
254 # Due to circular dependencies, should only be depended on through //net.
255 # Limit visibility to //net and other source_sets with the same access
256 # restriction.
257 visibility = [
258 ":dns",
259 ":host_resolver",
260 "//net",
261 ]
262
Ryan Sleevia9d6aa62019-07-26 13:32:18263 # Restricted access so we can keep track of all usage external to the
Eric Orth0bea1662019-03-20 19:11:22264 # network stack and network service.
265 friend = [
Eric Orth89f8c0d2019-04-08 16:42:45266 # chromecast/browser/url_request_context_factory.cc
267 # URLRequestContext creation for chromecast.
268 "//chromecast/browser",
269
Eric Orth4e55b362019-05-07 22:00:03270 # Tests and test support.
271 "//components/cronet:cronet_common_unittests",
272
Eric Orth0bea1662019-03-20 19:11:22273 # Network stack/service.
274 "//net/*",
275 "//services/network/*",
276 ]
277
David Benjaminead319b2021-05-05 21:48:17278 sources = [ "host_resolver_manager.h" ]
Eric Orth0bea1662019-03-20 19:11:22279 public = []
280
Eric Orth0bea1662019-03-20 19:11:22281 deps = [
282 ":host_resolver",
283 "//net:net_deps",
284 "//net/dns/public",
285 ]
Nico Webera2afc7f2020-01-13 21:06:20286 public_deps = [ "//net:net_public_deps" ]
Eric Orth0bea1662019-03-20 19:11:22287}
288
Eric Orth1556c382018-11-08 06:05:02289# DnsClient interfaces. Primarily intended as part of the implementation of the
Eric Orth24feb5b2018-05-25 19:42:46290# standard HostResolver interface, but can be used as an alternative external
291# interface for advanced usage.
Eric Orth24feb5b2018-05-25 19:42:46292source_set("dns_client") {
293 # Due to circular dependencies, should only be depended on through //net.
294 # Limit visibility to //net and other source_sets with the same access
295 # restriction.
296 visibility = [
297 ":dns",
298 ":mdns_client",
299 "//net",
300 ]
301
Ryan Sleevia9d6aa62019-07-26 13:32:18302 # Restricted access so we can keep track of all usage external to the
Eric Orth24feb5b2018-05-25 19:42:46303 # network stack.
304 friend = [
Eric Orth1556c382018-11-08 06:05:02305 # chrome/browser/local_discovery/service_discovery_client_impl.cc
306 # Result parsing utilities for parsing results read through MdnsClient.
307 # TODO(crbug.com/874662): Remove once migrated to network service.
Eric Orth24feb5b2018-05-25 19:42:46308 "//chrome/browser",
Eric Orth1556c382018-11-08 06:05:02309
Yeunjoo Choic74b67a72021-06-11 08:08:36310 # chrome/browser/ash/smb_client/discovery/mdns_host_locator.cc
Eric Orth1556c382018-11-08 06:05:02311 # Result parsing for results read through MdnsClient.
312 # TODO(crbug.com/902531): Remove once migrated to network service.
Henrique Ferreiro5e1bdf32022-09-12 23:18:53313 "//chrome/browser/ash",
Eric Orth1556c382018-11-08 06:05:02314
315 # Tests and test support
316 "//chrome/browser:test_support",
Eric Orth24feb5b2018-05-25 19:42:46317 "//chrome/test/*",
Eric Orth1556c382018-11-08 06:05:02318
319 # Network stack/service
Eric Orth24feb5b2018-05-25 19:42:46320 "//components/certificate_transparency/*",
321 "//net/*",
Eric Orth168a7e52018-08-27 19:11:32322 "//services/network/*",
Eric Orth24feb5b2018-05-25 19:42:46323 ]
324
David Benjaminead319b2021-05-05 21:48:17325 sources = [
326 "dns_client.h",
327 "dns_response.h",
328 "dns_transaction.h",
329 "https_record_rdata.h",
Sukrit Ganesh93883ff62022-07-29 18:13:26330 "opt_record_rdata.h",
David Benjaminead319b2021-05-05 21:48:17331 "record_parsed.h",
332 "record_rdata.h",
333 ]
Eric Orth24feb5b2018-05-25 19:42:46334 public = []
335
Eric Orth24feb5b2018-05-25 19:42:46336 deps = [
dalykbd726ee2019-05-30 01:44:06337 ":host_resolver",
Eric Orth24feb5b2018-05-25 19:42:46338 "//net:net_deps",
339 ]
340 public_deps = [
341 "//net:net_public_deps",
Eric Orth8afaf152018-11-07 21:01:26342 "//net/dns/public",
Eric Orth24feb5b2018-05-25 19:42:46343 ]
344}
345
346# MdnsClient interfaces.
Eric Orth24feb5b2018-05-25 19:42:46347source_set("mdns_client") {
348 # Due to circular dependencies, should only be depended on through //net.
349 # Limit visibility to //net and other source_sets with the same access
350 # restriction.
351 visibility = [
352 ":dns",
353 "//net",
354 ]
355
Ryan Sleevia9d6aa62019-07-26 13:32:18356 # Restricted access so we can keep track of all usage external to the
Eric Orth24feb5b2018-05-25 19:42:46357 # network stack.
358 friend = [
Eric Orth1556c382018-11-08 06:05:02359 # chrome/browser/local_discovery/service_discovery_client_mdns.h
360 # chrome/browser/local_discovery/service_discovery_client_impl.h
361 # Makes MDNS queries using MDnsClient.
362 # TODO(crbug.com/874662): Remove once migrated to network service.
Eric Orth24feb5b2018-05-25 19:42:46363 "//chrome/browser",
Eric Orth1556c382018-11-08 06:05:02364
365 # chrome/tools/service_discovery_sniffer/service_discovery_sniffer.cc
366 # Creates MDnsClient instance and passes to ServiceDiscoveryClientImpl.
367 # TODO(crbug.com/874662): Remove once discovery client migrated.
Eric Orth24feb5b2018-05-25 19:42:46368 "//chrome/tools/service_discovery_sniffer",
Eric Orth1556c382018-11-08 06:05:02369
Yeunjoo Choic74b67a72021-06-11 08:08:36370 # chrome/browser/ash/smb_client/discovery/mdns_host_locator.h
371 # chrome/browser/ash/smb_client/discovery/mdns_host_locator.cc
Eric Orth1556c382018-11-08 06:05:02372 # Makes MDNS queries using MDnsClient.
373 # TODO(crbug.com/902531): Remove once migrated to network service.
Henrique Ferreiro5e1bdf32022-09-12 23:18:53374 "//chrome/browser/ash",
Eric Orth1556c382018-11-08 06:05:02375
376 # Tests and test support
377 "//chrome/browser:test_support",
378
379 # Network stack/service
Eric Orth24feb5b2018-05-25 19:42:46380 "//net/*",
Qingsi Wangc2213d5d2018-11-02 01:28:12381 "//services/network/*",
Eric Orth24feb5b2018-05-25 19:42:46382 ]
383
384 public = []
385 sources = []
386
David Benjaminead319b2021-05-05 21:48:17387 if (enable_mdns) {
Eric Orth24feb5b2018-05-25 19:42:46388 sources += [ "mdns_client.h" ]
389 }
390
391 deps = [
392 ":dns_client",
Eric Orth168a7e52018-08-27 19:11:32393 ":host_resolver",
Eric Orth24feb5b2018-05-25 19:42:46394 "//net:net_deps",
395 ]
Nico Webera2afc7f2020-01-13 21:06:20396 public_deps = [ "//net:net_public_deps" ]
Eric Orth24feb5b2018-05-25 19:42:46397}
398
Eric Orth24feb5b2018-05-25 19:42:46399source_set("tests") {
400 testonly = true
401 sources = [
Scott Sheehan135dadb2019-10-30 17:50:47402 "address_info_unittest.cc",
Eric Orth5233c3a2019-04-08 17:01:14403 "context_host_resolver_unittest.cc",
Cammie Smith Barnes958c7f32020-12-17 16:43:11404 "dns_alias_utility_unittest.cc",
Eric Orth24feb5b2018-05-25 19:42:46405 "dns_config_service_unittest.cc",
Eric Orth24feb5b2018-05-25 19:42:46406 "dns_hosts_unittest.cc",
Eric Orth02c98932022-12-02 23:05:46407 "dns_names_util_unittest.cc",
Eric Orth24feb5b2018-05-25 19:42:46408 "dns_query_unittest.cc",
Eric Orth9cec76f2020-11-17 07:42:42409 "dns_response_result_extractor_unittest.cc",
Eric Orth24feb5b2018-05-25 19:42:46410 "dns_response_unittest.cc",
Eric Orth24feb5b2018-05-25 19:42:46411 "dns_transaction_unittest.cc",
Eric Orthf8680ac2020-06-10 22:57:24412 "dns_udp_tracker_unittest.cc",
Eric Orth24feb5b2018-05-25 19:42:46413 "dns_util_unittest.cc",
414 "host_cache_unittest.cc",
Eric Orthda551f02023-06-01 19:27:05415 "host_resolver_cache_unittest.cc",
Eric Orthb6b2ead2022-11-01 16:50:30416 "host_resolver_internal_result_unittest.cc",
Eric Orth960e7062019-03-08 18:43:54417 "host_resolver_manager_unittest.cc",
Eric Orth464d51452020-10-29 14:48:20418 "https_record_rdata_unittest.cc",
Daniel McArdle4e2037e2020-06-11 22:40:51419 "httpssvc_metrics_unittest.cc",
Matthew Denton6e5518d2023-06-01 08:27:01420 "loopback_only_unittest.cc",
Eric Orth24feb5b2018-05-25 19:42:46421 "mapped_host_resolver_unittest.cc",
Eric Orth54ce38f2021-04-06 18:19:48422 "nsswitch_reader_unittest.cc",
Sukrit Ganesh93883ff62022-07-29 18:13:26423 "opt_record_rdata_unittest.cc",
Eric Orth24feb5b2018-05-25 19:42:46424 "record_parsed_unittest.cc",
425 "record_rdata_unittest.cc",
Eric Orthf3495942020-01-31 21:14:18426 "resolve_context_unittest.cc",
Eric Orth24feb5b2018-05-25 19:42:46427 "serial_worker_unittest.cc",
Eric Orthde0c5662019-06-25 15:36:02428 "system_dns_config_change_notifier_unittest.cc",
Eric Orth24feb5b2018-05-25 19:42:46429 ]
430
Sylvain Defresne2a262082020-09-15 11:19:58431 if (is_win) {
432 sources += [ "dns_config_service_win_unittest.cc" ]
433 }
434
Eric Orthf18db28c92021-02-09 01:54:35435 if (is_android) {
436 sources += [ "dns_config_service_android_unittest.cc" ]
Eric Orthf79bc2e2021-04-02 22:23:06437 } else if (is_linux) {
438 sources += [ "dns_config_service_linux_unittest.cc" ]
Christian Dullweber1b2df5912021-11-03 11:37:35439 } else if (is_posix) {
Eric Orth24feb5b2018-05-25 19:42:46440 sources += [ "dns_config_service_posix_unittest.cc" ]
441 }
442
443 if (enable_built_in_dns) {
Eric Orth394db1732019-08-27 20:09:39444 sources += [
445 "address_sorter_unittest.cc",
446 "dns_client_unittest.cc",
447 ]
Eric Orth24feb5b2018-05-25 19:42:46448 if (is_posix || is_fuchsia) {
449 sources += [ "address_sorter_posix_unittest.cc" ]
450 }
451 }
452
Eric Orth24feb5b2018-05-25 19:42:46453 if (enable_mdns) {
454 sources += [
455 "mdns_cache_unittest.cc",
456 "mdns_client_unittest.cc",
457 ]
458 }
459
460 deps = [
461 "//base",
462 "//net",
463 "//net:test_support",
464 "//testing/gmock",
465 "//testing/gtest",
466 ]
Eric Orth24feb5b2018-05-25 19:42:46467}
468
469source_set("test_support") {
Eric Orthaf82b49a2020-02-01 01:48:50470 visibility = [ "//net:test_support" ]
Eric Orth24feb5b2018-05-25 19:42:46471 testonly = true
472 sources = [
473 "dns_test_util.cc",
Eric Orth8e17cbc2022-11-11 10:34:56474 "host_resolver_internal_result_test_util.cc",
Eric Orthd39d0672021-11-16 21:17:58475 "host_resolver_results_test_util.cc",
Eric Orth24feb5b2018-05-25 19:42:46476 "mock_host_resolver.cc",
477 ]
478 public = [
479 "dns_test_util.h",
Eric Orth8e17cbc2022-11-11 10:34:56480 "host_resolver_internal_result_test_util.h",
Eric Orthd39d0672021-11-16 21:17:58481 "host_resolver_results_test_util.h",
Eric Orth24feb5b2018-05-25 19:42:46482 "mock_host_resolver.h",
483 ]
484
485 if (enable_mdns) {
Eric Orth9871aafa2018-10-02 19:59:18486 sources += [
487 "mock_mdns_client.cc",
488 "mock_mdns_socket_factory.cc",
489 ]
490 public += [
491 "mock_mdns_client.h",
492 "mock_mdns_socket_factory.h",
493 ]
Eric Orth24feb5b2018-05-25 19:42:46494 }
495
496 deps = [
497 "//base",
498 "//net",
499 "//testing/gmock",
500 "//testing/gtest",
501 ]
502}
503
Max Morozc3dc6fc2019-08-29 20:04:28504if (use_fuzzing_engine) {
505 # fuzzer_test targets are no-op when |use_fuzzing_engine| is false. Fuzzer
506 # support targets should be disabled too.
507 source_set("fuzzer_test_support") {
508 testonly = true
509 sources = [
510 "fuzzed_host_resolver_util.cc",
511 "fuzzed_host_resolver_util.h",
512 ]
513 deps = [
514 "//base",
515 "//base/test:test_support",
516 "//net",
517 ]
518 }
Eric Orth24feb5b2018-05-25 19:42:46519}
520
Dan McArdlea6116fd2021-09-23 17:21:52521proto_library("host_cache_fuzzer_proto") {
522 proto_in_dir = "//"
523 sources = [ "host_cache_fuzzer.proto" ]
524 deps = [ "//testing/libfuzzer/proto:json_proto" ]
525}
526
Daniel McArdlebeba04c522020-05-05 20:49:17527fuzzer_test("net_dns_host_cache_fuzzer") {
528 sources = [ "host_cache_fuzzer.cc" ]
529 deps = [
Dan McArdlea6116fd2021-09-23 17:21:52530 ":host_cache_fuzzer_proto",
Daniel McArdlebeba04c522020-05-05 20:49:17531 "//base",
532 "//net",
533 "//net:net_fuzzer_test_support",
Dan McArdlea6116fd2021-09-23 17:21:52534 "//testing/libfuzzer/proto:json_proto",
535 "//testing/libfuzzer/proto:json_proto_converter",
536 "//third_party/libprotobuf-mutator",
Daniel McArdlebeba04c522020-05-05 20:49:17537 ]
538 dict = "//testing/libfuzzer/fuzzers/dicts/json.dict"
539}
540
Eric Orth24feb5b2018-05-25 19:42:46541fuzzer_test("net_dns_hosts_parse_fuzzer") {
Nico Webera2afc7f2020-01-13 21:06:20542 sources = [ "dns_hosts_parse_fuzzer.cc" ]
Eric Orth24feb5b2018-05-25 19:42:46543 deps = [
544 "//base",
545 "//net",
546 "//net:net_fuzzer_test_support",
547 ]
548 dict = "//net/data/fuzzer_dictionaries/net_dns_hosts_parse_fuzzer.dict"
549}
550
Eric Orth6e90f822023-09-15 15:26:38551fuzzer_test("net_dns_host_resolver_cache_fuzzer") {
552 sources = [ "host_resolver_cache_fuzzer.cc" ]
553 deps = [
554 "//base",
555 "//net",
556 "//net:net_fuzzer_test_support",
557 "//testing/libfuzzer/proto:json_proto",
558 "//testing/libfuzzer/proto:json_proto_converter",
559 "//third_party/libprotobuf-mutator",
560 ]
561}
562
Eric Orth59fa4b22020-10-29 17:35:32563fuzzer_test("net_dns_https_record_rdata_fuzzer") {
564 sources = [ "https_record_rdata_fuzzer.cc" ]
565 deps = [
566 "//base",
567 "//net",
568 "//net:net_fuzzer_test_support",
569 ]
570 dict = "//net/data/fuzzer_dictionaries/net_dns_record_fuzzer.dict"
571}
572
Eric Orthdd746b72021-04-06 21:03:23573fuzzer_test("net_dns_nsswitch_reader_fuzzer") {
574 sources = [ "nsswitch_reader_fuzzer.cc" ]
575 deps = [
576 "//base",
577 "//net",
578 "//net:net_fuzzer_test_support",
579 ]
580 dict = "//net/data/fuzzer_dictionaries/net_dns_nsswitch_reader_fuzzer.dict"
581}
582
Eric Orth24feb5b2018-05-25 19:42:46583fuzzer_test("net_dns_record_fuzzer") {
Nico Webera2afc7f2020-01-13 21:06:20584 sources = [ "dns_record_fuzzer.cc" ]
Eric Orth24feb5b2018-05-25 19:42:46585 deps = [
586 "//base",
587 "//net",
588 "//net:net_fuzzer_test_support",
589 ]
590 dict = "//net/data/fuzzer_dictionaries/net_dns_record_fuzzer.dict"
591}
592
Qingsi Wangecd69252018-09-27 21:35:55593fuzzer_test("net_dns_query_parse_fuzzer") {
Nico Webera2afc7f2020-01-13 21:06:20594 sources = [ "dns_query_parse_fuzzer.cc" ]
Qingsi Wangecd69252018-09-27 21:35:55595 deps = [
596 "//base",
597 "//net",
598 "//net:net_fuzzer_test_support",
599 ]
600 dict = "//net/data/fuzzer_dictionaries/net_dns_record_fuzzer.dict"
601}
602
Qingsi Wang65841072018-10-09 01:14:45603fuzzer_test("net_dns_response_fuzzer") {
Nico Webera2afc7f2020-01-13 21:06:20604 sources = [ "dns_response_fuzzer.cc" ]
Qingsi Wang65841072018-10-09 01:14:45605 deps = [
606 "//base",
607 "//net",
608 "//net:net_fuzzer_test_support",
609 ]
610 dict = "//net/data/fuzzer_dictionaries/net_dns_record_fuzzer.dict"
611}
612
Eric Orth960e7062019-03-08 18:43:54613fuzzer_test("net_host_resolver_manager_fuzzer") {
Nico Webera2afc7f2020-01-13 21:06:20614 sources = [ "host_resolver_manager_fuzzer.cc" ]
Eric Orth24feb5b2018-05-25 19:42:46615 deps = [
616 "//base",
617 "//net",
618 "//net:net_fuzzer_test_support",
619 "//net:test_support",
620 ]
Eric Orth960e7062019-03-08 18:43:54621 dict = "//net/data/fuzzer_dictionaries/net_host_resolver_manager_fuzzer.dict"
Eric Orth24feb5b2018-05-25 19:42:46622}
Max Morozf5eeca02018-12-01 18:43:30623
624if (is_win) {
625 fuzzer_test("net_dns_parse_domain_ascii_win_fuzzer") {
Nico Webera2afc7f2020-01-13 21:06:20626 sources = [ "dns_parse_domain_ascii_win_fuzzer.cc" ]
Max Morozf5eeca02018-12-01 18:43:30627 deps = [
628 "//base",
629 "//net",
630 "//net:net_fuzzer_test_support",
631 ]
Max Morozcd52e3f2019-10-10 20:04:47632 dict = "//net/data/fuzzer_dictionaries/net_dns_hosts_parse_fuzzer.dict"
633 seed_corpus = "//net/data/fuzzer_data/dns_parse_domain_ascii_win_fuzzer"
Max Morozf5eeca02018-12-01 18:43:30634 }
635}