Port Chromium's blink_tests target to GN.
[chromium-blink-merge.git] / net / net.gyp
blob3db83b5fa0dbcf3c6a0b65a37182690cb9117bfb
1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6   'variables': {
7     'chromium_code': 1,
9     'linux_link_kerberos%': 0,
10     'conditions': [
11       ['chromeos==1 or embedded==1 or OS=="android" or OS=="ios"', {
12         # Disable Kerberos on ChromeOS, Android and iOS, at least for now.
13         # It needs configuration (krb5.conf and so on).
14         'use_kerberos%': 0,
15       }, {  # chromeos == 0 and embedded==0 and OS!="android" and OS!="ios"
16         'use_kerberos%': 1,
17       }],
18       ['OS=="android" and target_arch != "ia32"', {
19         # The way the cache uses mmap() is inefficient on some Android devices.
20         # If this flag is set, we hackily avoid using mmap() in the disk cache.
21         # We are pretty confident that mmap-ing the index would not hurt any
22         # existing x86 android devices, but we cannot be so sure about the
23         # variety of ARM devices. So enable it for x86 only for now.
24         'posix_avoid_mmap%': 1,
25       }, {
26         'posix_avoid_mmap%': 0,
27       }],
28       ['OS=="ios"', {
29         # Websockets and socket stream are not used on iOS.
30         'enable_websockets%': 0,
31         # iOS does not use V8.
32         'use_v8_in_net%': 0,
33         'enable_built_in_dns%': 0,
34       }, {
35         'enable_websockets%': 1,
36         'use_v8_in_net%': 1,
37         'enable_built_in_dns%': 1,
38       }],
39     ],
40   },
41   'includes': [
42     '../build/win_precompile.gypi',
43     'net.gypi',
44   ],
45   'targets': [
46     {
47       'target_name': 'net_derived_sources',
48       'type': 'none',
49       'sources': [
50         'base/registry_controlled_domains/effective_tld_names.gperf',
51         'base/registry_controlled_domains/effective_tld_names_unittest1.gperf',
52         'base/registry_controlled_domains/effective_tld_names_unittest2.gperf',
53         'base/registry_controlled_domains/effective_tld_names_unittest3.gperf',
54         'base/registry_controlled_domains/effective_tld_names_unittest4.gperf',
55         'base/registry_controlled_domains/effective_tld_names_unittest5.gperf',
56         'base/registry_controlled_domains/effective_tld_names_unittest6.gperf',
57       ],
58       'rules': [
59         {
60           'rule_name': 'dafsa',
61           'extension': 'gperf',
62           'outputs': [
63             '<(SHARED_INTERMEDIATE_DIR)/net/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT)-inc.cc',
64           ],
65           'inputs': [
66             'tools/tld_cleanup/make_dafsa.py',
67           ],
68           'action': [
69             'python',
70             'tools/tld_cleanup/make_dafsa.py',
71             '<(RULE_INPUT_PATH)',
72             '<(SHARED_INTERMEDIATE_DIR)/net/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT)-inc.cc',
73           ],
74         },
75       ],
76       'direct_dependent_settings': {
77         'include_dirs': [
78           '<(SHARED_INTERMEDIATE_DIR)'
79         ],
80       },
81     },
82     {
83       # Protobuf compiler / generator for QUIC crypto protocol buffer.
84       # GN version: //net/quic/proto
85       'target_name': 'net_quic_proto',
86       'type': 'static_library',
87       'sources': [
88         'quic/proto/cached_network_parameters.proto',
89         'quic/proto/source_address_token.proto',
90       ],
91       'variables': {
92         'enable_wexit_time_destructors': 1,
93         'proto_in_dir': 'quic/proto',
94         'proto_out_dir': 'net/quic/proto',
95         'cc_generator_options': 'dllexport_decl=NET_EXPORT_PRIVATE:',
96         'cc_include': 'net/base/net_export.h',
97       },
98       'includes': [
99         '../build/protoc.gypi',
100       ],
101       'defines': [
102         'NET_IMPLEMENTATION',
103       ],
104     },
105     {
106       # GN version: //net
107       'target_name': 'net',
108       'dependencies': [
109         '../base/base.gyp:base_i18n',
110         '../third_party/icu/icu.gyp:icui18n',
111         '../third_party/icu/icu.gyp:icuuc',
112         '../third_party/protobuf/protobuf.gyp:protobuf_lite',
113         '../url/url.gyp:url_lib',
114         'net_quic_proto',
115       ],
116       'sources': [
117         'base/filename_util_icu.cc',
118         'base/net_string_util_icu.cc',
119         'base/net_util_icu.cc',
120       ],
121       'includes': [ 'net_common.gypi' ],
122     },
123     {
124       # GN version: //net:net_unittests
125       'target_name': 'net_unittests',
126       'type': '<(gtest_target_type)',
127       'dependencies': [
128         '../base/base.gyp:base',
129         '../base/base.gyp:base_i18n',
130         '../base/base.gyp:base_prefs_test_support',
131         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
132         '../crypto/crypto.gyp:crypto',
133         '../crypto/crypto.gyp:crypto_test_support',
134         '../testing/gmock.gyp:gmock',
135         '../testing/gtest.gyp:gtest',
136         '../third_party/zlib/zlib.gyp:zlib',
137         '../url/url.gyp:url_lib',
138         'balsa',
139         'http_server',
140         'net',
141         'net_quic_proto',
142         'net_derived_sources',
143         'net_extras',
144         'net_test_support',
145         'simple_quic_tools',
146       ],
147       'sources': [
148         '<@(net_test_sources)',
149       ],
150       'conditions': [
151         ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
152           'dependencies': [
153             'epoll_quic_tools',
154             'epoll_server',
155             'flip_in_mem_edsm_server_base',
156           ],
157           'sources': [
158             '<@(net_linux_test_sources)',
159           ],
160         }],
161         ['OS == "mac" or OS == "ios"', {
162           'sources': [
163             '<@(net_base_test_mac_ios_sources)',
164           ],
165         }],
166         ['chromeos==1', {
167           'sources!': [
168             'proxy/proxy_config_service_linux_unittest.cc',
169           ],
170         }],
171         [ 'OS == "android"', {
172           'sources!': [
173             # See bug http://crbug.com/344533.
174             'disk_cache/blockfile/index_table_v3_unittest.cc',
175           ],
176           'dependencies': [
177             'net_javatests',
178             'net_test_jni_headers',
179           ],
180         }],
181         [ 'use_nss_certs != 1', {
182           'sources!': [
183             'cert/nss_cert_database_unittest.cc',
184             'cert/nss_cert_database_chromeos_unittest.cc',
185             'cert/nss_profile_filter_chromeos_unittest.cc',
186             'ssl/client_cert_store_chromeos_unittest.cc',
187             'ssl/client_cert_store_nss_unittest.cc',
188           ],
189         }],
190         [ 'use_openssl == 1', {
191           # Avoid compiling/linking with the system library.
192           'dependencies': [
193             '../third_party/boringssl/boringssl.gyp:boringssl',
194           ],
195         }],
196         [ 'use_nss_certs == 1 or OS == "ios" or use_openssl == 0', {
197           'conditions': [
198             [ 'desktop_linux == 1 or chromeos == 1', {
199               'dependencies': [
200                 '../build/linux/system.gyp:ssl',
201               ],
202             }, {  # desktop_linux == 0 and chromeos == 0
203               'dependencies': [
204                 '../third_party/nss/nss.gyp:nspr',
205                 '../third_party/nss/nss.gyp:nss',
206                 'third_party/nss/ssl.gyp:libssl',
207               ],
208             }],
209           ],
210         }],
211         [ 'os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
212           'conditions': [
213             ['use_allocator!="none"', {
214               'dependencies': [
215                 '../base/allocator/allocator.gyp:allocator',
216               ],
217             }],
218           ],
219         }],
220         [ 'use_kerberos==1', {
221           'defines': [
222             'USE_KERBEROS',
223           ],
224         }, { # use_kerberos == 0
225           'sources!': [
226             'http/http_auth_gssapi_posix_unittest.cc',
227             'http/http_auth_handler_negotiate_unittest.cc',
228             'http/mock_gssapi_library_posix.cc',
229             'http/mock_gssapi_library_posix.h',
230           ],
231         }],
232         [ 'use_openssl == 1 or (desktop_linux == 0 and chromeos == 0 and OS != "ios")', {
233           # Only include this test when on Posix and using NSS for
234           # cert verification or on iOS (which also uses NSS for certs).
235           'sources!': [
236             'cert_net/nss_ocsp_unittest.cc',
237           ],
238         }],
239         [ 'use_openssl==1', {
240             # When building for OpenSSL, we need to exclude NSS specific tests
241             # or functionality not supported by OpenSSL yet.
242             # TODO(bulach): Add equivalent tests when the underlying
243             #               functionality is ported to OpenSSL.
244             'sources!': [
245               'cert/x509_util_nss_unittest.cc',
246               'quic/test_tools/crypto_test_utils_nss.cc',
247             ],
248           }, {  # else !use_openssl: remove the unneeded files and pull in NSS.
249             'sources!': [
250               'cert/x509_util_openssl_unittest.cc',
251               'quic/test_tools/crypto_test_utils_openssl.cc',
252               'socket/ssl_client_socket_openssl_unittest.cc',
253               'ssl/ssl_client_session_cache_openssl_unittest.cc',
254             ],
255           },
256         ],
257         [ 'use_openssl_certs == 0', {
258             'sources!': [
259               'ssl/openssl_client_key_store_unittest.cc',
260             ],
261         }],
262         [ 'enable_websockets != 1', {
263             'sources/': [
264               ['exclude', '^websockets/'],
265               ['exclude', '^server/'],
266             ],
267             'dependencies!': [
268               'http_server',
269             ],
270         }],
271         ['disable_file_support==1', {
272           'sources!': [
273             'base/directory_lister_unittest.cc',
274             'url_request/url_request_file_job_unittest.cc',
275           ],
276         }],
277         [ 'disable_ftp_support==1', {
278             'sources/': [
279               ['exclude', '^ftp/'],
280             ],
281             'sources!': [
282               'url_request/url_request_ftp_job_unittest.cc',
283             ],
284           },
285         ],
286         [ 'enable_built_in_dns!=1', {
287             'sources!': [
288               'dns/address_sorter_posix_unittest.cc',
289               'dns/address_sorter_unittest.cc',
290             ],
291           },
292         ],
293         # Always need use_v8_in_net to be 1 to run gyp on Android, so just
294         # remove net_unittest's dependency on v8 when using icu alternatives
295         # instead of setting use_v8_in_net to 0.
296         [ 'use_v8_in_net==1 and use_icu_alternatives_on_android==0', {
297             'dependencies': [
298               'net_with_v8',
299             ],
300           }, {  # else: !use_v8_in_net
301             'sources!': [
302               'proxy/proxy_resolver_v8_tracing_unittest.cc',
303               'proxy/proxy_resolver_v8_unittest.cc',
304             ],
305           },
306         ],
308         [ 'use_v8_in_net==1 and OS != "android"', {
309             'dependencies': [
310               'net_with_v8',
311               'net_browser_services',
312               'net_utility_services',
313               '../third_party/mojo/mojo_edk.gyp:mojo_system_impl',
314             ],
315           }, {  # else
316             'sources!': [
317               'dns/host_resolver_mojo_unittest.cc',
318               'dns/mojo_host_resolver_impl_unittest.cc',
319               'proxy/load_state_change_coalescer_unittest.cc',
320               'proxy/mojo_proxy_resolver_factory_impl_unittest.cc',
321               'proxy/mojo_proxy_resolver_impl_unittest.cc',
322               'proxy/proxy_resolver_mojo_unittest.cc',
323               'proxy/proxy_service_mojo_unittest.cc',
324             ],
325           },
326         ],
328         [ 'enable_mdns != 1', {
329             'sources!' : [
330               'dns/mdns_cache_unittest.cc',
331               'dns/mdns_client_unittest.cc',
332               'dns/mdns_query_unittest.cc',
333               'dns/record_parsed_unittest.cc',
334               'dns/record_rdata_unittest.cc',
335             ],
336         }],
337         [ 'OS == "win"', {
338             'sources!': [
339               'dns/dns_config_service_posix_unittest.cc',
340               'http/http_auth_gssapi_posix_unittest.cc',
341             ],
342             # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
343             'msvs_disabled_warnings': [4267, ],
344             'conditions': [
345               [ 'icu_use_data_file_flag == 0', {
346                 # This is needed to trigger the dll copy step on windows.
347                 # TODO(mark): Specifying this here shouldn't be necessary.
348                 'dependencies': [
349                   '../third_party/icu/icu.gyp:icudata',
350                 ],
351               }],
352             ],
353           },
354         ],
355         [ 'OS == "ios"', {
356             'actions': [
357               {
358                 'action_name': 'copy_test_data',
359                 'variables': {
360                   'test_data_files': [
361                     'data/ssl/certificates/',
362                     'data/test.html',
363                     'data/url_request_unittest/',
364                   ],
365                   'test_data_prefix': 'net',
366                 },
367                 'includes': [ '../build/copy_test_data_ios.gypi' ],
368               },
369             ],
370             'sources!': [
371               # TODO(droger): The following tests are disabled because the
372               # implementation is missing or incomplete.
373               # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
374               'base/keygen_handler_unittest.cc',
375               'disk_cache/backend_unittest.cc',
376               'disk_cache/blockfile/block_files_unittest.cc',
377               # Need to read input data files.
378               'filter/gzip_filter_unittest.cc',
379               # Need TestServer.
380               "cert_net/cert_net_fetcher_impl_unittest.cc",
381               'proxy/proxy_script_fetcher_impl_unittest.cc',
382               'socket/ssl_client_socket_unittest.cc',
383               'socket/ssl_server_socket_unittest.cc',
384               'spdy/fuzzing/hpack_fuzz_util_test.cc',
385               # Needs GetAppOutput().
386               'test/python_utils_unittest.cc',
387               'url_request/url_fetcher_impl_unittest.cc',
388               'url_request/url_request_context_builder_unittest.cc',
390               # The following tests are disabled because they don't apply to
391               # iOS.
392               # OS is not "linux" or "freebsd" or "openbsd".
393               'socket/unix_domain_client_socket_posix_unittest.cc',
394               'socket/unix_domain_listen_socket_posix_unittest.cc',
395               'socket/unix_domain_server_socket_posix_unittest.cc',
397               # See bug http://crbug.com/344533.
398               'disk_cache/blockfile/index_table_v3_unittest.cc',
399             ],
400         }],
401         ['OS == "android"', {
402           # TODO(mmenke):  This depends on test_support_base, which depends on
403           #                icu.  Figure out a way to remove that dependency.
404           'dependencies': [
405             '../testing/android/native_test.gyp:native_test_native_code',
406           ]
407         }],
408         [ 'use_icu_alternatives_on_android == 1', {
409             'dependencies!': [
410               '../base/base.gyp:base_i18n',
411             ],
412             'sources!': [
413               'base/filename_util_unittest.cc',
414               'base/net_util_icu_unittest.cc',
415             ],
416           },
417         ],
418         ['use_v8_in_net==1 and v8_use_external_startup_data==1', {
419           'dependencies': [
420             '../gin/gin.gyp:gin',
421           ]
422         }],
423       ],
424       'target_conditions': [
425         # These source files are excluded by default platform rules, but they
426         # are needed in specific cases on other platforms. Re-including them can
427         # only be done in target_conditions as it is evaluated after the
428         # platform rules.
429         ['OS == "android"', {
430           'sources/': [
431             ['include', '^base/address_tracker_linux_unittest\\.cc$'],
432           ],
433         }],
434         ['OS == "ios"', {
435           'sources/': [
436             ['include', '^base/mac/url_conversions_unittest\\.mm$'],
437           ],
438         }],
439       ],
440     },
441     {
442       'target_name': 'net_perftests',
443       'type': 'executable',
444       'dependencies': [
445         '../base/base.gyp:base',
446         '../base/base.gyp:base_i18n',
447         '../base/base.gyp:test_support_perf',
448         '../testing/gtest.gyp:gtest',
449         '../url/url.gyp:url_lib',
450         'net',
451         'net_test_support',
452       ],
453       'sources': [
454         'cookies/cookie_monster_perftest.cc',
455         'disk_cache/blockfile/disk_cache_perftest.cc',
456         'proxy/proxy_resolver_perftest.cc',
457         'udp/udp_socket_perftest.cc',
458         'websockets/websocket_frame_perftest.cc',
459       ],
460       'conditions': [
461         [ 'use_v8_in_net==1', {
462             'dependencies': [
463               'net_with_v8',
464             ],
465           }, {  # else: !use_v8_in_net
466             'sources!': [
467               'proxy/proxy_resolver_perftest.cc',
468             ],
469           },
470         ],
471         [ 'OS == "win"', {
472             'conditions': [
473               [ 'icu_use_data_file_flag == 0', {
474                 # This is needed to trigger the dll copy step on windows.
475                 # TODO(mark): Specifying this here shouldn't be necessary.
476                 'dependencies': [
477                   '../third_party/icu/icu.gyp:icudata',
478                 ],
479               }],
480             ],
481             # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
482             'msvs_disabled_warnings': [4267, ],
483         }],
484         [ 'enable_websockets != 1', {
485           'sources!': [
486             'websockets/websocket_frame_perftest.cc',
487           ],
488         }],
489       ],
490     },
491     {
492       'target_name': 'net_test_support',
493       'type': 'static_library',
494       'dependencies': [
495         '../base/base.gyp:base',
496         '../base/base.gyp:test_support_base',
497         '../crypto/crypto.gyp:crypto',
498         '../net/tools/tld_cleanup/tld_cleanup.gyp:tld_cleanup_util',
499         '../testing/gtest.gyp:gtest',
500         '../testing/gmock.gyp:gmock',
501         '../url/url.gyp:url_lib',
502         'net',
503       ],
504       'export_dependent_settings': [
505         '../base/base.gyp:base',
506         # TODO(mmenke):  This depends on icu, figure out a way to build tests
507         #                without icu.
508         '../base/base.gyp:test_support_base',
509         '../crypto/crypto.gyp:crypto',
510         '../testing/gtest.gyp:gtest',
511         '../testing/gmock.gyp:gmock',
512       ],
513       'sources': [
514         'base/load_timing_info_test_util.cc',
515         'base/load_timing_info_test_util.h',
516         'base/mock_file_stream.cc',
517         'base/mock_file_stream.h',
518         'base/test_completion_callback.cc',
519         'base/test_completion_callback.h',
520         'base/test_data_directory.cc',
521         'base/test_data_directory.h',
522         'cert/mock_cert_verifier.cc',
523         'cert/mock_cert_verifier.h',
524         'cookies/cookie_monster_store_test.cc',
525         'cookies/cookie_monster_store_test.h',
526         'cookies/cookie_store_test_callbacks.cc',
527         'cookies/cookie_store_test_callbacks.h',
528         'cookies/cookie_store_test_helpers.cc',
529         'cookies/cookie_store_test_helpers.h',
530         'disk_cache/disk_cache_test_base.cc',
531         'disk_cache/disk_cache_test_base.h',
532         'disk_cache/disk_cache_test_util.cc',
533         'disk_cache/disk_cache_test_util.h',
534         'dns/dns_test_util.cc',
535         'dns/dns_test_util.h',
536         'dns/mock_host_resolver.cc',
537         'dns/mock_host_resolver.h',
538         'dns/mock_mdns_socket_factory.cc',
539         'dns/mock_mdns_socket_factory.h',
540         'http/http_transaction_test_util.cc',
541         'http/http_transaction_test_util.h',
542         'log/test_net_log.cc',
543         'log/test_net_log.h',
544         'log/test_net_log_entry.cc',
545         'log/test_net_log_entry.h',
546         'log/test_net_log_util.cc',
547         'log/test_net_log_util.h',
548         'proxy/mock_proxy_resolver.cc',
549         'proxy/mock_proxy_resolver.h',
550         'proxy/mock_proxy_script_fetcher.cc',
551         'proxy/mock_proxy_script_fetcher.h',
552         'proxy/proxy_config_service_common_unittest.cc',
553         'proxy/proxy_config_service_common_unittest.h',
554         'socket/socket_test_util.cc',
555         'socket/socket_test_util.h',
556         'test/cert_test_util.cc',
557         'test/cert_test_util.h',
558         'test/cert_test_util_nss.cc',
559         'test/ct_test_util.cc',
560         'test/ct_test_util.h',
561         'test/embedded_test_server/embedded_test_server.cc',
562         'test/embedded_test_server/embedded_test_server.h',
563         'test/embedded_test_server/http_connection.cc',
564         'test/embedded_test_server/http_connection.h',
565         'test/embedded_test_server/http_request.cc',
566         'test/embedded_test_server/http_request.h',
567         'test/embedded_test_server/http_response.cc',
568         'test/embedded_test_server/http_response.h',
569         'test/event_waiter.h',
570         'test/net_test_suite.cc',
571         'test/net_test_suite.h',
572         'test/python_utils.cc',
573         'test/python_utils.h',
574         'test/spawned_test_server/base_test_server.cc',
575         'test/spawned_test_server/base_test_server.h',
576         'test/spawned_test_server/local_test_server.cc',
577         'test/spawned_test_server/local_test_server.h',
578         'test/spawned_test_server/local_test_server_posix.cc',
579         'test/spawned_test_server/local_test_server_win.cc',
580         'test/spawned_test_server/remote_test_server.cc',
581         'test/spawned_test_server/remote_test_server.h',
582         'test/spawned_test_server/spawned_test_server.h',
583         'test/spawned_test_server/spawner_communicator.cc',
584         'test/spawned_test_server/spawner_communicator.h',
585         'test/url_request/url_request_failed_job.cc',
586         'test/url_request/url_request_failed_job.h',
587         'test/url_request/url_request_mock_data_job.cc',
588         'test/url_request/url_request_mock_data_job.h',
589         'test/url_request/url_request_slow_download_job.cc',
590         'test/url_request/url_request_slow_download_job.h',
591         'url_request/test_url_fetcher_factory.cc',
592         'url_request/test_url_fetcher_factory.h',
593         'url_request/url_request_test_util.cc',
594         'url_request/url_request_test_util.h',
595       ],
596       'conditions': [
597         ['OS != "ios"', {
598           'dependencies': [
599             '../third_party/protobuf/protobuf.gyp:py_proto',
600           ],
601         }],
602         ['use_openssl == 0 and (use_nss_certs == 1 or OS == "ios")', {
603           'conditions': [
604             [ 'desktop_linux == 1 or chromeos == 1', {
605               'dependencies': [
606                 '../build/linux/system.gyp:ssl',
607               ],
608             }, {  # desktop_linux == 0 and chromeos == 0
609               'dependencies': [
610                 '../third_party/nss/nss.gyp:nspr',
611                 '../third_party/nss/nss.gyp:nss',
612                 'third_party/nss/ssl.gyp:libssl',
613               ],
614             }],
615           ],
616         }],
617         ['os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
618           'conditions': [
619             ['use_allocator!="none"', {
620               'dependencies': [
621                 '../base/allocator/allocator.gyp:allocator',
622               ],
623             }],
624           ],
625         }],
626         ['OS != "android"', {
627           'sources!': [
628             'test/spawned_test_server/remote_test_server.cc',
629             'test/spawned_test_server/remote_test_server.h',
630             'test/spawned_test_server/spawner_communicator.cc',
631             'test/spawned_test_server/spawner_communicator.h',
632           ],
633         }],
634         [ 'use_v8_in_net==1', {
635             'dependencies': [
636               'net_with_v8',
637             ],
638           },
639         ],
640         [ 'enable_mdns != 1', {
641             'sources!' : [
642               'dns/mock_mdns_socket_factory.cc',
643               'dns/mock_mdns_socket_factory.h'
644             ]
645         }],
646         [ 'use_nss_certs != 1', {
647             'sources!': [
648               'test/cert_test_util_nss.cc',
649             ],
650         }],
651         ['disable_file_support != 1', {
652           'sources': [
653             'test/url_request/url_request_mock_http_job.cc',
654             'test/url_request/url_request_mock_http_job.h',
655             'url_request/test_url_request_interceptor.cc',
656             'url_request/test_url_request_interceptor.h',
657           ],
658         }],
659       ],
660       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
661       'msvs_disabled_warnings': [4267, ],
662     },
663     {
664       'target_name': 'net_resources',
665       'type': 'none',
666       'variables': {
667         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/net',
668       },
669       'actions': [
670         {
671           'action_name': 'net_resources',
672           'variables': {
673             'grit_grd_file': 'base/net_resources.grd',
674           },
675           'includes': [ '../build/grit_action.gypi' ],
676         },
677       ],
678     },
679     {
680       'target_name': 'net_extras',
681       'type': 'static_library',
682       'variables': { 'enable_wexit_time_destructors': 1, },
683       'dependencies': [
684         '../base/base.gyp:base',
685         '../sql/sql.gyp:sql',
686         'net',
687       ],
688       'sources': [
689         '<@(net_extras_sources)',
690       ],
691     },
692     {
693       'target_name': 'net_docs',
694       'type': 'none',
695       'actions': [
696         {
697           'action_name': 'net_docs',
698           'variables': {
699             'net_docs_input_dir': '.',
700           },
701           'inputs': [
702             '<@(net_docs_sources)',
703           ],
704           'outputs': [
705             '<(net_docs_output_dir)',
706           ],
707           'action': [
708             'python',
709             '<(net_docs_script)',
710             '--input_path',
711             '<(net_docs_input_dir)',
712             '--output_path',
713             '<(net_docs_output_dir)',
714             '<@(net_docs_sources)',
715           ],
716           'message': 'Rendering network stack documentation',
717         }
718       ],
719     },
720     {
721       'target_name': 'http_server',
722       'type': 'static_library',
723       'variables': { 'enable_wexit_time_destructors': 1, },
724       'dependencies': [
725         '../base/base.gyp:base',
726         'net',
727       ],
728       'sources': [
729         'server/http_connection.cc',
730         'server/http_connection.h',
731         'server/http_server.cc',
732         'server/http_server.h',
733         'server/http_server_request_info.cc',
734         'server/http_server_request_info.h',
735         'server/http_server_response_info.cc',
736         'server/http_server_response_info.h',
737         'server/web_socket.cc',
738         'server/web_socket.h',
739         'server/web_socket_encoder.cc',
740         'server/web_socket_encoder.h',
741       ],
742       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
743       'msvs_disabled_warnings': [4267, ],
744     },
745     { # GN version: //net:balsa
746       'target_name': 'balsa',
747       'type': 'static_library',
748       'dependencies': [
749         '../base/base.gyp:base',
750         'net',
751       ],
752       'sources': [
753         'tools/balsa/balsa_enums.h',
754         'tools/balsa/balsa_frame.cc',
755         'tools/balsa/balsa_frame.h',
756         'tools/balsa/balsa_headers.cc',
757         'tools/balsa/balsa_headers.h',
758         'tools/balsa/balsa_headers_token_utils.cc',
759         'tools/balsa/balsa_headers_token_utils.h',
760         'tools/balsa/balsa_visitor_interface.h',
761         'tools/balsa/http_message_constants.cc',
762         'tools/balsa/http_message_constants.h',
763         'tools/balsa/noop_balsa_visitor.h',
764         'tools/balsa/simple_buffer.cc',
765         'tools/balsa/simple_buffer.h',
766         'tools/balsa/split.cc',
767         'tools/balsa/split.h',
768         'tools/balsa/string_piece_utils.h',
769         'tools/quic/spdy_balsa_utils.cc',
770         'tools/quic/spdy_balsa_utils.h',
771       ],
772     },
773     {
774       'target_name': 'dump_cache',
775       'type': 'executable',
776       'dependencies': [
777         '../base/base.gyp:base',
778         'net',
779         'net_test_support',
780       ],
781       'sources': [
782         'tools/dump_cache/cache_dumper.cc',
783         'tools/dump_cache/cache_dumper.h',
784         'tools/dump_cache/dump_cache.cc',
785         'tools/dump_cache/dump_files.cc',
786         'tools/dump_cache/dump_files.h',
787         'tools/dump_cache/simple_cache_dumper.cc',
788         'tools/dump_cache/simple_cache_dumper.h',
789         'tools/dump_cache/url_to_filename_encoder.cc',
790         'tools/dump_cache/url_to_filename_encoder.h',
791         'tools/dump_cache/url_utilities.cc',
792         'tools/dump_cache/url_utilities.h',
793       ],
794       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
795       'msvs_disabled_warnings': [4267, ],
796     },
797     {
798       'target_name': 'simple_quic_tools',
799       'type': 'static_library',
800       'dependencies': [
801         '../base/base.gyp:base',
802         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
803         '../url/url.gyp:url_lib',
804         'net',
805         'net_quic_proto',
806       ],
807       'sources': [
808         'tools/quic/quic_client_session.cc',
809         'tools/quic/quic_client_session.h',
810         'tools/quic/quic_dispatcher.cc',
811         'tools/quic/quic_dispatcher.h',
812         'tools/quic/quic_in_memory_cache.cc',
813         'tools/quic/quic_in_memory_cache.h',
814         'tools/quic/quic_per_connection_packet_writer.cc',
815         'tools/quic/quic_per_connection_packet_writer.h',
816         'tools/quic/quic_server_session.cc',
817         'tools/quic/quic_server_session.h',
818         'tools/quic/quic_simple_client.cc',
819         'tools/quic/quic_simple_client.h',
820         'tools/quic/quic_simple_per_connection_packet_writer.cc',
821         'tools/quic/quic_simple_per_connection_packet_writer.h',
822         'tools/quic/quic_simple_server.cc',
823         'tools/quic/quic_simple_server.h',
824         'tools/quic/quic_simple_server_packet_writer.cc',
825         'tools/quic/quic_simple_server_packet_writer.h',
826         'tools/quic/quic_spdy_client_stream.cc',
827         'tools/quic/quic_spdy_client_stream.h',
828         'tools/quic/quic_spdy_server_stream.cc',
829         'tools/quic/quic_spdy_server_stream.h',
830         'tools/quic/quic_time_wait_list_manager.cc',
831         'tools/quic/quic_time_wait_list_manager.h',
832         'tools/quic/synchronous_host_resolver.cc',
833         'tools/quic/synchronous_host_resolver.h',
834       ],
835     },
836   ],
837   'conditions': [
838     ['use_v8_in_net == 1', {
839       'targets': [
840         {
841           'target_name': 'net_with_v8',
842           'type': '<(component)',
843           'variables': { 'enable_wexit_time_destructors': 1, },
844           'dependencies': [
845             '../base/base.gyp:base',
846             '../gin/gin.gyp:gin',
847             '../url/url.gyp:url_lib',
848             '../v8/tools/gyp/v8.gyp:v8',
849             'net'
850           ],
851           'defines': [
852             'NET_IMPLEMENTATION',
853           ],
854           'sources': [
855             'proxy/proxy_resolver_v8.cc',
856             'proxy/proxy_resolver_v8.h',
857             'proxy/proxy_resolver_v8_tracing.cc',
858             'proxy/proxy_resolver_v8_tracing.h',
859             'proxy/proxy_service_v8.cc',
860             'proxy/proxy_service_v8.h',
861           ],
862           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
863           'msvs_disabled_warnings': [4267, ],
864         },
865       ],
866     }],
867     ['use_v8_in_net == 1 and OS != "android"', {
868       'targets': [
869         {
870           # GN version: //net/interfaces
871           'target_name': 'net_interfaces',
872           'type': 'static_library',
873           'sources': [
874             'interfaces/host_resolver_service.mojom',
875             'interfaces/proxy_resolver_service.mojom',
876           ],
877           'includes': [
878             '../third_party/mojo/mojom_bindings_generator.gypi',
879           ],
880         },
881         {
882           # GN version: //net:net_browser_services
883           'target_name': 'net_browser_services',
884           'type': 'static_library',
885           'sources': [
886             'dns/mojo_host_resolver_impl.cc',
887             'dns/mojo_host_resolver_impl.h',
888             'proxy/in_process_mojo_proxy_resolver_factory.cc',
889             'proxy/in_process_mojo_proxy_resolver_factory.h',
890             'proxy/mojo_proxy_resolver_factory.h',
891             'proxy/proxy_resolver_mojo.cc',
892             'proxy/proxy_resolver_mojo.h',
893             'proxy/proxy_service_mojo.cc',
894             'proxy/proxy_service_mojo.h',
895           ],
896           'dependencies': [
897             'mojo_type_converters',
898             'net',
899             'net_interfaces',
900             '../mojo/mojo_base.gyp:mojo_common_lib',
901             '../mojo/mojo_base.gyp:mojo_environment_chromium',
902             '../mojo/mojo_base.gyp:mojo_url_type_converters',
903             '../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings',
905             # NOTE(amistry): As long as we support in-process Mojo v8 PAC, we
906             # need this dependency since in_process_mojo_proxy_resolver_factory
907             # creates the utility process side Mojo services in the browser
908             # process.  Ultimately, this will go away when we only support
909             # out-of-process.
910             'net_utility_services',
911           ],
912         },
913         {
914           # GN version: //net:net_utility_services
915           'target_name': 'net_utility_services',
916           'type': 'static_library',
917           'sources': [
918             'dns/host_resolver_mojo.cc',
919             'dns/host_resolver_mojo.h',
920             'proxy/load_state_change_coalescer.cc',
921             'proxy/load_state_change_coalescer.h',
922             'proxy/mojo_proxy_resolver_factory_impl.cc',
923             'proxy/mojo_proxy_resolver_factory_impl.h',
924             'proxy/mojo_proxy_resolver_impl.cc',
925             'proxy/mojo_proxy_resolver_impl.h',
926           ],
927           'dependencies': [
928             'mojo_type_converters',
929             'net_interfaces',
930             'net_with_v8',
931             '../mojo/mojo_base.gyp:mojo_url_type_converters',
932             '../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings',
933           ],
934         },
935         {
936           # GN version: //net:mojo_type_converters
937           'target_name': 'mojo_type_converters',
938           'type': 'static_library',
939           'sources': [
940             'dns/mojo_host_type_converters.cc',
941             'dns/mojo_host_type_converters.h',
942             'proxy/mojo_proxy_type_converters.cc',
943             'proxy/mojo_proxy_type_converters.h',
944           ],
945           'dependencies': [
946             'net',
947             'net_interfaces',
948             '../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings',
949           ],
950         },
951       ],
952     }],
953     ['OS != "ios" and OS != "android"', {
954       'targets': [
955         # iOS doesn't have the concept of simple executables, these targets
956         # can't be compiled on the platform.
957         {
958           'target_name': 'crash_cache',
959           'type': 'executable',
960           'dependencies': [
961             '../base/base.gyp:base',
962             'net',
963             'net_test_support',
964           ],
965           'sources': [
966             'tools/crash_cache/crash_cache.cc',
967           ],
968           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
969           'msvs_disabled_warnings': [4267, ],
970         },
971         {
972           'target_name': 'crl_set_dump',
973           'type': 'executable',
974           'dependencies': [
975             '../base/base.gyp:base',
976             'net',
977           ],
978           'sources': [
979             'tools/crl_set_dump/crl_set_dump.cc',
980           ],
981           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
982           'msvs_disabled_warnings': [4267, ],
983         },
984         {
985           'target_name': 'dns_fuzz_stub',
986           'type': 'executable',
987           'dependencies': [
988             '../base/base.gyp:base',
989             'net',
990           ],
991           'sources': [
992             'tools/dns_fuzz_stub/dns_fuzz_stub.cc',
993           ],
994           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
995           'msvs_disabled_warnings': [4267, ],
996         },
997         {
998           'target_name': 'gdig',
999           'type': 'executable',
1000           'dependencies': [
1001             '../base/base.gyp:base',
1002             'net',
1003           ],
1004           'sources': [
1005             'tools/gdig/file_net_log.cc',
1006             'tools/gdig/gdig.cc',
1007           ],
1008         },
1009         {
1010           'target_name': 'get_server_time',
1011           'type': 'executable',
1012           'dependencies': [
1013             '../base/base.gyp:base',
1014             '../base/base.gyp:base_i18n',
1015             '../url/url.gyp:url_lib',
1016             'net',
1017           ],
1018           'sources': [
1019             'tools/get_server_time/get_server_time.cc',
1020           ],
1021           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1022           'msvs_disabled_warnings': [4267, ],
1023         },
1024         {
1025           'target_name': 'hpack_example_generator',
1026           'type': 'executable',
1027           'dependencies': [
1028             '../base/base.gyp:base',
1029             'net',
1030           ],
1031           'sources': [
1032             'spdy/fuzzing/hpack_example_generator.cc',
1033           ],
1034           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1035           'msvs_disabled_warnings': [4267, ],
1036         },
1037         {
1038           'target_name': 'hpack_fuzz_mutator',
1039           'type': 'executable',
1040           'dependencies': [
1041             '../base/base.gyp:base',
1042             'net',
1043           ],
1044           'sources': [
1045             'spdy/fuzzing/hpack_fuzz_mutator.cc',
1046           ],
1047           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1048           'msvs_disabled_warnings': [4267, ],
1049         },
1050         {
1051           'target_name': 'hpack_fuzz_wrapper',
1052           'type': 'executable',
1053           'dependencies': [
1054             '../base/base.gyp:base',
1055             'net',
1056           ],
1057           'sources': [
1058             'spdy/fuzzing/hpack_fuzz_wrapper.cc',
1059           ],
1060           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1061           'msvs_disabled_warnings': [4267, ],
1062         },
1063         {
1064           'target_name': 'net_watcher',
1065           'type': 'executable',
1066           'dependencies': [
1067             '../base/base.gyp:base',
1068             'net',
1069             'net_with_v8',
1070           ],
1071           'conditions': [
1072             [ 'use_glib == 1', {
1073                 'dependencies': [
1074                   '../build/linux/system.gyp:gconf',
1075                   '../build/linux/system.gyp:gio',
1076                 ],
1077               },
1078             ],
1079           ],
1080           'sources': [
1081             'tools/net_watcher/net_watcher.cc',
1082           ],
1083         },
1084         {
1085           'target_name': 'run_testserver',
1086           'type': 'executable',
1087           'dependencies': [
1088             '../base/base.gyp:base',
1089             '../base/base.gyp:test_support_base',
1090             '../testing/gtest.gyp:gtest',
1091             'net_test_support',
1092           ],
1093           'sources': [
1094             'tools/testserver/run_testserver.cc',
1095           ],
1096         },
1097         {
1098           'target_name': 'quic_client',
1099           'type': 'executable',
1100           'dependencies': [
1101             '../base/base.gyp:base',
1102             '../url/url.gyp:url_lib',
1103             'net',
1104             'simple_quic_tools',
1105           ],
1106           'sources': [
1107             'tools/quic/quic_simple_client_bin.cc',
1108           ],
1109         },
1110         {
1111           'target_name': 'quic_server',
1112           'type': 'executable',
1113           'dependencies': [
1114             '../base/base.gyp:base',
1115             'net',
1116             'net_quic_proto',
1117             'simple_quic_tools',
1118           ],
1119           'sources': [
1120             'tools/quic/quic_simple_server_bin.cc',
1121           ],
1122         },
1123         {
1124           'target_name': 'stress_cache',
1125           'type': 'executable',
1126           'dependencies': [
1127             '../base/base.gyp:base',
1128             'net',
1129             'net_test_support',
1130           ],
1131           'sources': [
1132             'tools/stress_cache/stress_cache.cc',
1133           ],
1134           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1135           'msvs_disabled_warnings': [4267, ],
1136         },
1137         {
1138           'target_name': 'tld_cleanup',
1139           'type': 'executable',
1140           'dependencies': [
1141             '../base/base.gyp:base',
1142             '../base/base.gyp:base_i18n',
1143             '../net/tools/tld_cleanup/tld_cleanup.gyp:tld_cleanup_util',
1144           ],
1145           'sources': [
1146             'tools/tld_cleanup/tld_cleanup.cc',
1147           ],
1148           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1149           'msvs_disabled_warnings': [4267, ],
1150         },
1151       ],
1152     }],
1153     ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
1154       'targets': [
1155         {
1156           'target_name': 'epoll_server',
1157           'type': 'static_library',
1158           'dependencies': [
1159             '../base/base.gyp:base',
1160             'net',
1161           ],
1162           'sources': [
1163             'tools/epoll_server/epoll_server.cc',
1164             'tools/epoll_server/epoll_server.h',
1165           ],
1166         },
1167         {
1168           'target_name': 'flip_in_mem_edsm_server_base',
1169           'type': 'static_library',
1170           'cflags': [
1171             '-Wno-deprecated',
1172           ],
1173           'dependencies': [
1174             '../base/base.gyp:base',
1175             '../third_party/boringssl/boringssl.gyp:boringssl',
1176             'balsa',
1177             'epoll_server',
1178             'net',
1179           ],
1180           'sources': [
1181             'tools/dump_cache/url_to_filename_encoder.cc',
1182             'tools/dump_cache/url_to_filename_encoder.h',
1183             'tools/dump_cache/url_utilities.cc',
1184             'tools/dump_cache/url_utilities.h',
1185             'tools/flip_server/acceptor_thread.cc',
1186             'tools/flip_server/acceptor_thread.h',
1187             'tools/flip_server/constants.h',
1188             'tools/flip_server/create_listener.cc',
1189             'tools/flip_server/create_listener.h',
1190             'tools/flip_server/flip_config.cc',
1191             'tools/flip_server/flip_config.h',
1192             'tools/flip_server/http_interface.cc',
1193             'tools/flip_server/http_interface.h',
1194             'tools/flip_server/loadtime_measurement.h',
1195             'tools/flip_server/mem_cache.cc',
1196             'tools/flip_server/mem_cache.h',
1197             'tools/flip_server/output_ordering.cc',
1198             'tools/flip_server/output_ordering.h',
1199             'tools/flip_server/ring_buffer.cc',
1200             'tools/flip_server/ring_buffer.h',
1201             'tools/flip_server/sm_connection.cc',
1202             'tools/flip_server/sm_connection.h',
1203             'tools/flip_server/sm_interface.h',
1204             'tools/flip_server/spdy_interface.cc',
1205             'tools/flip_server/spdy_interface.h',
1206             'tools/flip_server/spdy_ssl.cc',
1207             'tools/flip_server/spdy_ssl.h',
1208             'tools/flip_server/spdy_util.cc',
1209             'tools/flip_server/spdy_util.h',
1210             'tools/flip_server/streamer_interface.cc',
1211             'tools/flip_server/streamer_interface.h',
1212           ],
1213         },
1214         {
1215           'target_name': 'flip_in_mem_edsm_server_unittests',
1216           'type': 'executable',
1217           'dependencies': [
1218               '../testing/gtest.gyp:gtest',
1219               '../testing/gmock.gyp:gmock',
1220               '../third_party/boringssl/boringssl.gyp:boringssl',
1221               'flip_in_mem_edsm_server_base',
1222               'net',
1223               'net_test_support',
1224           ],
1225           'sources': [
1226             'tools/flip_server/flip_test_utils.cc',
1227             'tools/flip_server/flip_test_utils.h',
1228             'tools/flip_server/http_interface_test.cc',
1229             'tools/flip_server/mem_cache_test.cc',
1230             'tools/flip_server/run_all_tests.cc',
1231             'tools/flip_server/spdy_interface_test.cc',
1232           ],
1233         },
1234         {
1235           'target_name': 'flip_in_mem_edsm_server',
1236           'type': 'executable',
1237           'cflags': [
1238             '-Wno-deprecated',
1239           ],
1240           'dependencies': [
1241             '../base/base.gyp:base',
1242             'flip_in_mem_edsm_server_base',
1243             'net',
1244           ],
1245           'sources': [
1246             'tools/flip_server/flip_in_mem_edsm_server.cc',
1247           ],
1248         },
1249         {
1250           'target_name': 'epoll_quic_tools',
1251           'type': 'static_library',
1252           'dependencies': [
1253             '../base/base.gyp:base',
1254             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
1255             '../url/url.gyp:url_lib',
1256             'balsa',
1257             'epoll_server',
1258             'net',
1259             'net_quic_proto',
1260           ],
1261           'sources': [
1262             'tools/quic/quic_client.cc',
1263             'tools/quic/quic_client.h',
1264             'tools/quic/quic_default_packet_writer.cc',
1265             'tools/quic/quic_default_packet_writer.h',
1266             'tools/quic/quic_epoll_clock.cc',
1267             'tools/quic/quic_epoll_clock.h',
1268             'tools/quic/quic_epoll_connection_helper.cc',
1269             'tools/quic/quic_epoll_connection_helper.h',
1270             'tools/quic/quic_packet_reader.cc',
1271             'tools/quic/quic_packet_reader.h',
1272             'tools/quic/quic_packet_writer_wrapper.cc',
1273             'tools/quic/quic_packet_writer_wrapper.h',
1274             'tools/quic/quic_server.cc',
1275             'tools/quic/quic_server.h',
1276             'tools/quic/quic_socket_utils.cc',
1277             'tools/quic/quic_socket_utils.h',
1278           ],
1279         },
1280         {
1281           'target_name': 'epoll_quic_client',
1282           'type': 'executable',
1283           'dependencies': [
1284             '../base/base.gyp:base',
1285             'net',
1286             'epoll_quic_tools',
1287             'simple_quic_tools',
1288           ],
1289           'sources': [
1290             'tools/quic/quic_client_bin.cc',
1291           ],
1292         },
1293         {
1294           'target_name': 'epoll_quic_server',
1295           'type': 'executable',
1296           'dependencies': [
1297             '../base/base.gyp:base',
1298             'net',
1299             'net_quic_proto',
1300             'epoll_quic_tools',
1301             'simple_quic_tools',
1302           ],
1303           'sources': [
1304             'tools/quic/quic_server_bin.cc',
1305           ],
1306         },
1307       ]
1308     }],
1309     ['OS=="android"', {
1310       'targets': [
1311         { # The same target as 'net', but with smaller binary size due to
1312           # exclusion of ICU, FTP, FILE and WebSockets support.
1313           'target_name': 'net_small',
1314           'variables': {
1315             'disable_ftp_support': 1,
1316             'disable_file_support': 1,
1317             'enable_websockets': 0,
1318             'use_icu_alternatives_on_android': 1,
1319           },
1320           'dependencies': [
1321             '../url/url.gyp:url_lib_use_icu_alternatives_on_android',
1322           ],
1323           'defines': [
1324             'USE_ICU_ALTERNATIVES_ON_ANDROID=1',
1325             'DISABLE_FILE_SUPPORT=1',
1326             'DISABLE_FTP_SUPPORT=1',
1327           ],
1328           'sources': [
1329             'base/net_string_util_icu_alternatives_android.cc',
1330             'base/net_string_util_icu_alternatives_android.h',
1331           ],
1332           'includes': [ 'net_common.gypi' ],
1333         },
1334         {
1335           'target_name': 'net_jni_headers',
1336           'type': 'none',
1337           'sources': [
1338             'android/java/src/org/chromium/net/AndroidCertVerifyResult.java',
1339             'android/java/src/org/chromium/net/AndroidKeyStore.java',
1340             'android/java/src/org/chromium/net/AndroidNetworkLibrary.java',
1341             'android/java/src/org/chromium/net/AndroidPrivateKey.java',
1342             'android/java/src/org/chromium/net/GURLUtils.java',
1343             'android/java/src/org/chromium/net/NetStringUtil.java',
1344             'android/java/src/org/chromium/net/NetworkChangeNotifier.java',
1345             'android/java/src/org/chromium/net/ProxyChangeListener.java',
1346             'android/java/src/org/chromium/net/X509Util.java',
1347           ],
1348           'variables': {
1349             'jni_gen_package': 'net',
1350           },
1351           'includes': [ '../build/jni_generator.gypi' ],
1352         },
1353         {
1354           'target_name': 'net_test_jni_headers',
1355           'type': 'none',
1356           'sources': [
1357             'android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java',
1358           ],
1359           'variables': {
1360             'jni_gen_package': 'net',
1361           },
1362           'includes': [ '../build/jni_generator.gypi' ],
1363         },
1364         {
1365           'target_name': 'net_java',
1366           'type': 'none',
1367           'variables': {
1368             'java_in_dir': '../net/android/java',
1369           },
1370           'dependencies': [
1371             '../base/base.gyp:base',
1372             'cert_verify_status_android_java',
1373             'certificate_mime_types_java',
1374             'network_change_notifier_types_java',
1375             'net_errors_java',
1376             'private_key_types_java',
1377             'remote_android_keystore_aidl',
1378           ],
1379           'includes': [ '../build/java.gypi' ],
1380         },
1381         {
1382           # Processes the interface files for communication with an Android KeyStore
1383           # running in a separate process.
1384           'target_name': 'remote_android_keystore_aidl',
1385           'type': 'none',
1386           'variables': {
1387             'aidl_interface_file': '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStoreInterface.aidl',
1388           },
1389           'sources': [
1390             '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStore.aidl',
1391             '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStoreCallbacks.aidl',
1392           ],
1393           'includes': [ '../build/java_aidl.gypi' ],
1394         },
1395         {
1396           'target_name': 'net_java_test_support',
1397           'type': 'none',
1398           'variables': {
1399             'java_in_dir': '../net/test/android/javatests',
1400           },
1401           'dependencies': [
1402             'url_request_failed_job_java',
1403             '../base/base.gyp:base_java'
1404           ],
1405           'includes': [ '../build/java.gypi' ],
1406         },
1407         {
1408           'target_name': 'url_request_failed_job_java',
1409           'type': 'none',
1410           'variables': {
1411             'source_file': 'test/url_request/url_request_failed_job.h',
1412           },
1413           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1414         },
1415         {
1416           'target_name': 'net_javatests',
1417           'type': 'none',
1418           'variables': {
1419             'java_in_dir': '../net/android/javatests',
1420           },
1421           'dependencies': [
1422             '../base/base.gyp:base',
1423             '../base/base.gyp:base_java_test_support',
1424             'net_java',
1425           ],
1426           'includes': [ '../build/java.gypi' ],
1427         },
1428         {
1429           'target_name': 'net_errors_java',
1430           'type': 'none',
1431           'sources': [
1432             'android/java/NetError.template',
1433           ],
1434           'variables': {
1435             'package_name': 'org/chromium/net',
1436             'template_deps': ['base/net_error_list.h'],
1437           },
1438           'includes': [ '../build/android/java_cpp_template.gypi' ],
1439         },
1440         {
1441           'target_name': 'certificate_mime_types_java',
1442           'type': 'none',
1443           'variables': {
1444             'source_file': 'base/mime_util.h',
1445           },
1446           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1447         },
1448         {
1449           'target_name': 'cert_verify_status_android_java',
1450           'type': 'none',
1451           'variables': {
1452             'source_file': 'android/cert_verify_result_android.h',
1453           },
1454           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1455         },
1456         {
1457           'target_name': 'network_change_notifier_types_java',
1458           'type': 'none',
1459           'variables': {
1460             'source_file': 'base/network_change_notifier.h',
1461           },
1462           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1463         },
1464         {
1465           'target_name': 'private_key_types_java',
1466           'type': 'none',
1467           'variables': {
1468             'source_file': 'android/keystore.h',
1469           },
1470           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1471         },
1472         {
1473           'target_name': 'net_unittests_apk',
1474           'type': 'none',
1475           'dependencies': [
1476             'net_java',
1477             'net_javatests',
1478             'net_unittests',
1479           ],
1480           'conditions': [
1481             ['v8_use_external_startup_data==1', {
1482               'dependencies': [
1483                 '../v8/tools/gyp/v8.gyp:v8_external_snapshot',
1484               ],
1485               'copies': [
1486                 {
1487                 'destination': '<(asset_location)',
1488                   'files': [
1489                     '<(PRODUCT_DIR)/natives_blob.bin',
1490                     '<(PRODUCT_DIR)/snapshot_blob.bin',
1491                   ],
1492                 },
1493               ],
1494             }],
1495           ],
1496           'variables': {
1497             'test_suite_name': 'net_unittests',
1498             'conditions': [
1499               ['v8_use_external_startup_data==1', {
1500                 'asset_location': '<(PRODUCT_DIR)/net_unittests_apk/assets',
1501                 'additional_input_paths': [
1502                   '<(PRODUCT_DIR)/net_unittests_apk/assets/natives_blob.bin',
1503                   '<(PRODUCT_DIR)/net_unittests_apk/assets/snapshot_blob.bin',
1504                 ],
1505                 'inputs': [
1506                   '<(PRODUCT_DIR)/natives_blob.bin',
1507                   '<(PRODUCT_DIR)/snapshot_blob.bin',
1508                 ],
1509               }],
1510             ],
1511           },
1512           'includes': [ '../build/apk_test.gypi' ],
1513         },
1514       ],
1515     }],
1516     ['OS == "android" or OS == "linux"', {
1517       'targets': [
1518         {
1519           'target_name': 'disk_cache_memory_test',
1520           'type': 'executable',
1521           'dependencies': [
1522             '../base/base.gyp:base',
1523             'net',
1524           ],
1525           'sources': [
1526             'tools/disk_cache_memory_test/disk_cache_memory_test.cc',
1527           ],
1528         },
1529       ],
1530     }],
1531     ['test_isolation_mode != "noop"', {
1532       'targets': [
1533         {
1534           'target_name': 'net_unittests_run',
1535           'type': 'none',
1536           'dependencies': [
1537             'net_unittests',
1538           ],
1539           'includes': [
1540             '../build/isolate.gypi',
1541           ],
1542           'sources': [
1543             'net_unittests.isolate',
1544           ],
1545         },
1546       ],
1547     }],
1548   ],