Roll src/third_party/skia d751ac0:4611e7f
[chromium-blink-merge.git] / net / net.gyp
blobe570e8ebb73587f62184562558e32ea0416f88ee
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       'target_name': 'net',
84       'type': '<(component)',
85       'variables': { 'enable_wexit_time_destructors': 1, },
86       'dependencies': [
87         '../base/base.gyp:base',
88         '../base/base.gyp:base_i18n',
89         '../base/base.gyp:base_prefs',
90         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
91         '../crypto/crypto.gyp:crypto',
92         '../sdch/sdch.gyp:sdch',
93         '../third_party/icu/icu.gyp:icui18n',
94         '../third_party/icu/icu.gyp:icuuc',
95         '../third_party/zlib/zlib.gyp:zlib',
96         '../url/url.gyp:url_lib',
97         'net_derived_sources',
98         'net_resources',
99       ],
100       'sources': [
101         '<@(net_nacl_common_sources)',
102         '<@(net_non_nacl_sources)',
103       ],
104       'defines': [
105         'NET_IMPLEMENTATION',
106       ],
107       'export_dependent_settings': [
108         '../base/base.gyp:base',
109       ],
110       'conditions': [
111         ['chromeos==1', {
112           'sources!': [
113              'base/network_change_notifier_linux.cc',
114              'base/network_change_notifier_linux.h',
115              'base/network_change_notifier_netlink_linux.cc',
116              'base/network_change_notifier_netlink_linux.h',
117              'proxy/proxy_config_service_linux.cc',
118              'proxy/proxy_config_service_linux.h',
119           ],
120         }],
121         ['use_kerberos==1', {
122           'defines': [
123             'USE_KERBEROS',
124           ],
125           'conditions': [
126             ['OS=="openbsd"', {
127               'include_dirs': [
128                 '/usr/include/kerberosV'
129               ],
130             }],
131             ['linux_link_kerberos==1', {
132               'link_settings': {
133                 'ldflags': [
134                   '<!@(krb5-config --libs gssapi)',
135                 ],
136               },
137             }, { # linux_link_kerberos==0
138               'defines': [
139                 'DLOPEN_KERBEROS',
140               ],
141             }],
142           ],
143         }, { # use_kerberos == 0
144           'sources!': [
145             'http/http_auth_gssapi_posix.cc',
146             'http/http_auth_gssapi_posix.h',
147             'http/http_auth_handler_negotiate.h',
148             'http/http_auth_handler_negotiate.cc',
149           ],
150         }],
151         ['posix_avoid_mmap==1', {
152           'defines': [
153             'POSIX_AVOID_MMAP',
154           ],
155           'direct_dependent_settings': {
156             'defines': [
157               'POSIX_AVOID_MMAP',
158             ],
159           },
160           'sources!': [
161             'disk_cache/blockfile/mapped_file_posix.cc',
162           ],
163         }, { # else
164           'sources!': [
165             'disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc',
166           ],
167         }],
168         ['disable_file_support==1', {
169           # TODO(mmenke):  Should probably get rid of the dependency on
170           # net_resources in this case (It's used in net_util, to format
171           # directory listings.  Also used outside of net/).
172           'sources!': [
173             'base/directory_lister.cc',
174             'base/directory_lister.h',
175             'url_request/url_request_file_dir_job.cc',
176             'url_request/url_request_file_dir_job.h',
177             'url_request/url_request_file_job.cc',
178             'url_request/url_request_file_job.h',
179             'url_request/file_protocol_handler.cc',
180             'url_request/file_protocol_handler.h',
181           ],
182         }],
183         ['disable_ftp_support==1', {
184           'sources/': [
185             ['exclude', '^ftp/'],
186           ],
187           'sources!': [
188             'url_request/ftp_protocol_handler.cc',
189             'url_request/ftp_protocol_handler.h',
190             'url_request/url_request_ftp_job.cc',
191             'url_request/url_request_ftp_job.h',
192           ],
193         }],
194         ['enable_built_in_dns==1', {
195           'defines': [
196             'ENABLE_BUILT_IN_DNS',
197           ]
198         }, { # else
199           'sources!': [
200             'dns/address_sorter_posix.cc',
201             'dns/address_sorter_posix.h',
202             'dns/dns_client.cc',
203           ],
204         }],
205         ['use_openssl==1', {
206             'sources!': [
207               'base/crypto_module_nss.cc',
208               'base/keygen_handler_nss.cc',
209               'base/nss_memio.c',
210               'base/nss_memio.h',
211               'cert/cert_database_nss.cc',
212               'cert/cert_verify_proc_nss.cc',
213               'cert/cert_verify_proc_nss.h',
214               'cert/ct_log_verifier_nss.cc',
215               'cert/ct_objects_extractor_nss.cc',
216               'cert/jwk_serializer_nss.cc',
217               'cert/nss_cert_database.cc',
218               'cert/nss_cert_database.h',
219               'cert/nss_cert_database_chromeos.cc',
220               'cert/nss_cert_database_chromeos.h',
221               'cert/nss_profile_filter_chromeos.cc',
222               'cert/nss_profile_filter_chromeos.h',
223               'cert/scoped_nss_types.h',
224               'cert/test_root_certs_nss.cc',
225               'cert/x509_certificate_nss.cc',
226               'cert/x509_util_nss.cc',
227               'cert/x509_util_nss.h',
228               'ocsp/nss_ocsp.cc',
229               'ocsp/nss_ocsp.h',
230               'quic/crypto/aead_base_decrypter_nss.cc',
231               'quic/crypto/aead_base_encrypter_nss.cc',
232               'quic/crypto/aes_128_gcm_12_decrypter_nss.cc',
233               'quic/crypto/aes_128_gcm_12_encrypter_nss.cc',
234               'quic/crypto/chacha20_poly1305_decrypter_nss.cc',
235               'quic/crypto/chacha20_poly1305_encrypter_nss.cc',
236               'quic/crypto/channel_id_nss.cc',
237               'quic/crypto/p256_key_exchange_nss.cc',
238               'socket/nss_ssl_util.cc',
239               'socket/nss_ssl_util.h',
240               'socket/ssl_client_socket_nss.cc',
241               'socket/ssl_client_socket_nss.h',
242               'socket/ssl_server_socket_nss.cc',
243               'socket/ssl_server_socket_nss.h',
244               'third_party/mozilla_security_manager/nsKeygenHandler.cpp',
245               'third_party/mozilla_security_manager/nsKeygenHandler.h',
246               'third_party/mozilla_security_manager/nsNSSCertificateDB.cpp',
247               'third_party/mozilla_security_manager/nsNSSCertificateDB.h',
248               'third_party/mozilla_security_manager/nsPKCS12Blob.cpp',
249               'third_party/mozilla_security_manager/nsPKCS12Blob.h',
250             ],
251             'dependencies': [
252               '../third_party/boringssl/boringssl.gyp:boringssl',
253             ],
254           },
255           {  # else !use_openssl: remove the unneeded files and depend on NSS.
256             'sources!': [
257               'base/crypto_module_openssl.cc',
258               'cert/ct_log_verifier_openssl.cc',
259               'cert/ct_objects_extractor_openssl.cc',
260               'cert/jwk_serializer_openssl.cc',
261               'cert/x509_util_openssl.cc',
262               'cert/x509_util_openssl.h',
263               'crypto/scoped_openssl_types.h',
264               'quic/crypto/aead_base_decrypter_openssl.cc',
265               'quic/crypto/aead_base_encrypter_openssl.cc',
266               'quic/crypto/aes_128_gcm_12_decrypter_openssl.cc',
267               'quic/crypto/aes_128_gcm_12_encrypter_openssl.cc',
268               'quic/crypto/chacha20_poly1305_decrypter_openssl.cc',
269               'quic/crypto/chacha20_poly1305_encrypter_openssl.cc',
270               'quic/crypto/channel_id_openssl.cc',
271               'quic/crypto/p256_key_exchange_openssl.cc',
272               'quic/crypto/scoped_evp_aead_ctx.cc',
273               'quic/crypto/scoped_evp_aead_ctx.h',
274               'socket/ssl_client_socket_openssl.cc',
275               'socket/ssl_client_socket_openssl.h',
276               'socket/ssl_server_socket_openssl.cc',
277               'socket/ssl_server_socket_openssl.h',
278               'socket/ssl_session_cache_openssl.cc',
279               'socket/ssl_session_cache_openssl.h',
280               'ssl/openssl_platform_key_mac.cc',
281               'ssl/openssl_platform_key_win.cc',
282               'ssl/openssl_platform_key.h',
283               'ssl/openssl_ssl_util.cc',
284               'ssl/openssl_ssl_util.h',
285             ],
286             'conditions': [
287               # Pull in the bundled or system NSS as appropriate.
288               [ 'desktop_linux == 1 or chromeos == 1', {
289                 'dependencies': [
290                   '../build/linux/system.gyp:ssl',
291                 ],
292               }, {
293                 'dependencies': [
294                   '../third_party/nss/nss.gyp:nspr',
295                   '../third_party/nss/nss.gyp:nss',
296                   'third_party/nss/ssl.gyp:libssl',
297                 ],
298               }]
299             ],
300             # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
301             'msvs_disabled_warnings': [4267, ],
302           },
303         ],
304         [ 'use_openssl_certs == 0', {
305             'sources!': [
306               'base/keygen_handler_openssl.cc',
307               'base/openssl_private_key_store.h',
308               'base/openssl_private_key_store_android.cc',
309               'base/openssl_private_key_store_memory.cc',
310               'cert/cert_database_openssl.cc',
311               'cert/cert_verify_proc_openssl.cc',
312               'cert/cert_verify_proc_openssl.h',
313               'cert/test_root_certs_openssl.cc',
314               'cert/x509_certificate_openssl.cc',
315               'ssl/openssl_client_key_store.cc',
316               'ssl/openssl_client_key_store.h',
317             ],
318         }],
319         [ 'use_glib == 1', {
320             'dependencies': [
321               '../build/linux/system.gyp:gconf',
322               '../build/linux/system.gyp:gio',
323             ],
324         }],
325         [ 'desktop_linux == 1 or chromeos == 1', {
326             'conditions': [
327               ['os_bsd==1', {
328                 'sources!': [
329                   'base/network_change_notifier_linux.cc',
330                   'base/network_change_notifier_netlink_linux.cc',
331                   'proxy/proxy_config_service_linux.cc',
332                 ],
333               },{
334                 'dependencies': [
335                   '../build/linux/system.gyp:libresolv',
336                 ],
337               }],
338               ['OS=="solaris"', {
339                 'link_settings': {
340                   'ldflags': [
341                     '-R/usr/lib/mps',
342                   ],
343                 },
344               }],
345             ],
346           },
347           {  # else: OS is not in the above list
348             'sources!': [
349               'base/crypto_module_nss.cc',
350               'base/keygen_handler_nss.cc',
351               'cert/cert_database_nss.cc',
352               'cert/nss_cert_database.cc',
353               'cert/nss_cert_database.h',
354               'cert/test_root_certs_nss.cc',
355               'cert/x509_certificate_nss.cc',
356               'ocsp/nss_ocsp.cc',
357               'ocsp/nss_ocsp.h',
358               'third_party/mozilla_security_manager/nsKeygenHandler.cpp',
359               'third_party/mozilla_security_manager/nsKeygenHandler.h',
360               'third_party/mozilla_security_manager/nsNSSCertificateDB.cpp',
361               'third_party/mozilla_security_manager/nsNSSCertificateDB.h',
362               'third_party/mozilla_security_manager/nsPKCS12Blob.cpp',
363               'third_party/mozilla_security_manager/nsPKCS12Blob.h',
364             ],
365           },
366         ],
367         [ 'use_nss != 1', {
368             'sources!': [
369               'cert/cert_verify_proc_nss.cc',
370               'cert/cert_verify_proc_nss.h',
371               'ssl/client_cert_store_nss.cc',
372               'ssl/client_cert_store_nss.h',
373               'ssl/client_cert_store_chromeos.cc',
374               'ssl/client_cert_store_chromeos.h',
375             ],
376         }],
377         [ 'enable_websockets != 1', {
378             'sources/': [
379               ['exclude', '^socket_stream/'],
380               ['exclude', '^websockets/'],
381             ],
382             'sources!': [
383               'spdy/spdy_websocket_stream.cc',
384               'spdy/spdy_websocket_stream.h',
385             ],
386         }],
387         [ 'enable_mdns != 1', {
388             'sources!' : [
389               'dns/mdns_cache.cc',
390               'dns/mdns_cache.h',
391               'dns/mdns_client.cc',
392               'dns/mdns_client.h',
393               'dns/mdns_client_impl.cc',
394               'dns/mdns_client_impl.h',
395               'dns/record_parsed.cc',
396               'dns/record_parsed.h',
397               'dns/record_rdata.cc',
398               'dns/record_rdata.h',
399             ]
400         }],
401         [ 'OS == "win"', {
402             'sources!': [
403               'http/http_auth_handler_ntlm_portable.cc',
404               'socket/socket_libevent.cc',
405               'socket/socket_libevent.h',
406               'socket/tcp_socket_libevent.cc',
407               'socket/tcp_socket_libevent.h',
408               'udp/udp_socket_libevent.cc',
409               'udp/udp_socket_libevent.h',
410             ],
411           }, { # else: OS != "win"
412             'sources!': [
413               'base/winsock_init.cc',
414               'base/winsock_init.h',
415               'base/winsock_util.cc',
416               'base/winsock_util.h',
417               'proxy/proxy_resolver_winhttp.cc',
418               'proxy/proxy_resolver_winhttp.h',
419             ],
420           },
421         ],
422         [ 'OS == "mac"', {
423             'link_settings': {
424               'libraries': [
425                 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
426                 '$(SDKROOT)/System/Library/Frameworks/Security.framework',
427                 '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
428                 '$(SDKROOT)/usr/lib/libresolv.dylib',
429               ]
430             },
431           },
432         ],
433         [ 'OS == "ios"', {
434             'sources!': [
435               'disk_cache/blockfile/file_posix.cc',
436             ],
437             'link_settings': {
438               'libraries': [
439                 '$(SDKROOT)/System/Library/Frameworks/CFNetwork.framework',
440                 '$(SDKROOT)/System/Library/Frameworks/MobileCoreServices.framework',
441                 '$(SDKROOT)/System/Library/Frameworks/Security.framework',
442                 '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
443                 '$(SDKROOT)/usr/lib/libresolv.dylib',
444               ],
445             },
446           },
447         ],
448         ['OS=="android" and _toolset=="target" and android_webview_build == 0', {
449           'dependencies': [
450              'net_java',
451           ],
452         }],
453         [ 'OS == "android"', {
454             'dependencies': [
455               'net_jni_headers',
456             ],
457             'sources!': [
458               'base/openssl_private_key_store_memory.cc',
459               'cert/cert_database_openssl.cc',
460               'cert/cert_verify_proc_openssl.cc',
461               'cert/test_root_certs_openssl.cc',
462             ],
463           },
464         ],
465         [ 'use_icu_alternatives_on_android == 1', {
466             'dependencies!': [
467               '../base/base.gyp:base_i18n',
468               '../third_party/icu/icu.gyp:icui18n',
469               '../third_party/icu/icu.gyp:icuuc',
470             ],
471             'sources!': [
472               'base/filename_util_icu.cc',
473               'base/net_string_util_icu.cc',
474               'base/net_util_icu.cc',
475             ],
476             'sources': [
477               'base/net_string_util_icu_alternatives_android.cc',
478               'base/net_string_util_icu_alternatives_android.h',
479             ],
480           },
481         ],
482       ],
483       'target_conditions': [
484         # These source files are excluded by default platform rules, but they
485         # are needed in specific cases on other platforms. Re-including them can
486         # only be done in target_conditions as it is evaluated after the
487         # platform rules.
488         ['OS == "android"', {
489           'sources/': [
490             ['include', '^base/platform_mime_util_linux\\.cc$'],
491             ['include', '^base/address_tracker_linux\\.cc$'],
492             ['include', '^base/address_tracker_linux\\.h$'],
493           ],
494         }],
495         ['OS == "ios"', {
496           'sources/': [
497             ['include', '^base/network_change_notifier_mac\\.cc$'],
498             ['include', '^base/network_config_watcher_mac\\.cc$'],
499             ['include', '^base/platform_mime_util_mac\\.mm$'],
500             # The iOS implementation only partially uses NSS and thus does not
501             # defines |use_nss|. In particular the |USE_NSS| preprocessor
502             # definition is not used. The following files are needed though:
503             ['include', '^cert/cert_verify_proc_nss\\.cc$'],
504             ['include', '^cert/cert_verify_proc_nss\\.h$'],
505             ['include', '^cert/test_root_certs_nss\\.cc$'],
506             ['include', '^cert/x509_util_nss\\.cc$'],
507             ['include', '^cert/x509_util_nss\\.h$'],
508             ['include', '^proxy/proxy_resolver_mac\\.cc$'],
509             ['include', '^proxy/proxy_server_mac\\.cc$'],
510             ['include', '^ocsp/nss_ocsp\\.cc$'],
511             ['include', '^ocsp/nss_ocsp\\.h$'],
512           ],
513         }],
514       ],
515     },
516     {
517       'target_name': 'net_unittests',
518       'type': '<(gtest_target_type)',
519       'dependencies': [
520         '../base/base.gyp:base',
521         '../base/base.gyp:base_i18n',
522         '../base/base.gyp:base_prefs_test_support',
523         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
524         '../crypto/crypto.gyp:crypto',
525         '../crypto/crypto.gyp:crypto_test_support',
526         '../testing/gmock.gyp:gmock',
527         '../testing/gtest.gyp:gtest',
528         '../third_party/zlib/zlib.gyp:zlib',
529         '../url/url.gyp:url_lib',
530         'balsa',
531         'http_server',
532         'net',
533         'net_derived_sources',
534         'net_extras',
535         'net_test_support',
536         'quic_tools',
537       ],
538       'sources': [
539         '<@(net_test_sources)',
540       ],
541       'conditions': [
542         ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
543           'dependencies': [
544             'epoll_server',
545             'flip_in_mem_edsm_server_base',
546             'quic_base',
547           ],
548           'sources': [
549             '<@(net_linux_test_sources)',
550           ],
551         }],
552         ['chromeos==1', {
553           'sources!': [
554             'proxy/proxy_config_service_linux_unittest.cc',
555           ],
556         }],
557         [ 'OS == "android"', {
558           'sources!': [
559             # See bug http://crbug.com/344533.
560             'disk_cache/blockfile/index_table_v3_unittest.cc',
561             # No res_ninit() et al on Android, so this doesn't make a lot of
562             # sense.
563             'dns/dns_config_service_posix_unittest.cc',
564           ],
565           'dependencies': [
566             'net_javatests',
567             'net_test_jni_headers',
568           ],
569         }],
570         [ 'use_nss != 1', {
571           'sources!': [
572             'ssl/client_cert_store_nss_unittest.cc',
573             'ssl/client_cert_store_chromeos_unittest.cc',
574           ],
575         }],
576         [ 'use_openssl == 1', {
577           # Avoid compiling/linking with the system library.
578           'dependencies': [
579             '../third_party/boringssl/boringssl.gyp:boringssl',
580           ],
581         }, {  # use_openssl == 0
582           'conditions': [
583             [ 'desktop_linux == 1 or chromeos == 1', {
584               'dependencies': [
585                 '../build/linux/system.gyp:ssl',
586               ],
587             }, {  # desktop_linux == 0 and chromeos == 0
588               'dependencies': [
589                 '../third_party/nss/nss.gyp:nspr',
590                 '../third_party/nss/nss.gyp:nss',
591                 'third_party/nss/ssl.gyp:libssl',
592               ],
593               'sources!': [
594                 'cert/nss_cert_database_unittest.cc',
595               ],
596             }],
597           ],
598           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
599           'msvs_disabled_warnings': [4267, ],
600         }],
601         [ 'os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
602           'conditions': [
603             ['use_allocator!="none"', {
604               'dependencies': [
605                 '../base/allocator/allocator.gyp:allocator',
606               ],
607             }],
608           ],
609         }],
610         [ 'use_kerberos==1', {
611           'defines': [
612             'USE_KERBEROS',
613           ],
614         }, { # use_kerberos == 0
615           'sources!': [
616             'http/http_auth_gssapi_posix_unittest.cc',
617             'http/http_auth_handler_negotiate_unittest.cc',
618             'http/mock_gssapi_library_posix.cc',
619             'http/mock_gssapi_library_posix.h',
620           ],
621         }],
622         [ 'use_openssl == 1 or (desktop_linux == 0 and chromeos == 0 and OS != "ios")', {
623           # Only include this test when on Posix and using NSS for
624           # cert verification or on iOS (which also uses NSS for certs).
625           'sources!': [
626             'ocsp/nss_ocsp_unittest.cc',
627           ],
628         }],
629         [ 'use_openssl==1', {
630             # When building for OpenSSL, we need to exclude NSS specific tests
631             # or functionality not supported by OpenSSL yet.
632             # TODO(bulach): Add equivalent tests when the underlying
633             #               functionality is ported to OpenSSL.
634             'sources!': [
635               'cert/nss_cert_database_unittest.cc',
636               'cert/nss_cert_database_chromeos_unittest.cc',
637               'cert/nss_profile_filter_chromeos_unittest.cc',
638               'cert/x509_util_nss_unittest.cc',
639               'quic/test_tools/crypto_test_utils_nss.cc',
640             ],
641           }, {  # else !use_openssl: remove the unneeded files and pull in NSS.
642             'sources!': [
643               'cert/x509_util_openssl_unittest.cc',
644               'quic/test_tools/crypto_test_utils_openssl.cc',
645               'socket/ssl_client_socket_openssl_unittest.cc',
646               'socket/ssl_session_cache_openssl_unittest.cc',
647             ],
648           },
649         ],
650         [ 'use_openssl_certs == 0', {
651             'sources!': [
652               'ssl/openssl_client_key_store_unittest.cc',
653             ],
654         }],
655         [ 'enable_websockets != 1', {
656             'sources/': [
657               ['exclude', '^socket_stream/'],
658               ['exclude', '^websockets/'],
659               ['exclude', '^spdy/spdy_websocket_stream_unittest\\.cc$'],
660             ],
661         }],
662         ['disable_file_support==1', {
663           'sources!': [
664             'base/directory_lister_unittest.cc',
665             'url_request/url_request_file_job_unittest.cc',
666           ],
667         }],
668         [ 'disable_ftp_support==1', {
669             'sources/': [
670               ['exclude', '^ftp/'],
671             ],
672             'sources!': [
673               'url_request/url_request_ftp_job_unittest.cc',
674             ],
675           },
676         ],
677         [ 'enable_built_in_dns!=1', {
678             'sources!': [
679               'dns/address_sorter_posix_unittest.cc',
680               'dns/address_sorter_unittest.cc',
681             ],
682           },
683         ],
684         # Always need use_v8_in_net to be 1 to run gyp on Android, so just
685         # remove net_unittest's dependency on v8 when using icu alternatives
686         # instead of setting use_v8_in_net to 0.
687         [ 'use_v8_in_net==1 and use_icu_alternatives_on_android==0', {
688             'dependencies': [
689               'net_with_v8',
690             ],
691           }, {  # else: !use_v8_in_net
692             'sources!': [
693               'proxy/proxy_resolver_v8_unittest.cc',
694               'proxy/proxy_resolver_v8_tracing_unittest.cc',
695             ],
696           },
697         ],
699         [ 'enable_mdns != 1', {
700             'sources!' : [
701               'dns/mdns_cache_unittest.cc',
702               'dns/mdns_client_unittest.cc',
703               'dns/mdns_query_unittest.cc',
704               'dns/record_parsed_unittest.cc',
705               'dns/record_rdata_unittest.cc',
706             ],
707         }],
708         [ 'OS == "win"', {
709             'sources!': [
710               'dns/dns_config_service_posix_unittest.cc',
711               'http/http_auth_gssapi_posix_unittest.cc',
712             ],
713             'conditions': [
714               [ 'icu_use_data_file_flag == 0', {
715                 # This is needed to trigger the dll copy step on windows.
716                 # TODO(mark): Specifying this here shouldn't be necessary.
717                 'dependencies': [
718                   '../third_party/icu/icu.gyp:icudata',
719                 ],
720               }],
721             ],
722           },
723         ],
724         [ 'OS == "ios"', {
725             'actions': [
726               {
727                 'action_name': 'copy_test_data',
728                 'variables': {
729                   'test_data_files': [
730                     'data/ssl/certificates/',
731                     'data/test.html',
732                     'data/url_request_unittest/',
733                   ],
734                   'test_data_prefix': 'net',
735                 },
736                 'includes': [ '../build/copy_test_data_ios.gypi' ],
737               },
738             ],
739             'sources!': [
740               # TODO(droger): The following tests are disabled because the
741               # implementation is missing or incomplete.
742               # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
743               'base/keygen_handler_unittest.cc',
744               'disk_cache/backend_unittest.cc',
745               'disk_cache/blockfile/block_files_unittest.cc',
746               # Need to read input data files.
747               'filter/gzip_filter_unittest.cc',
748               'socket/ssl_server_socket_unittest.cc',
749               'spdy/fuzzing/hpack_fuzz_util_test.cc',
750               # Need TestServer.
751               'proxy/proxy_script_fetcher_impl_unittest.cc',
752               'socket/ssl_client_socket_unittest.cc',
753               'url_request/url_fetcher_impl_unittest.cc',
754               'url_request/url_request_context_builder_unittest.cc',
755               # Needs GetAppOutput().
756               'test/python_utils_unittest.cc',
758               # The following tests are disabled because they don't apply to
759               # iOS.
760               # OS is not "linux" or "freebsd" or "openbsd".
761               'socket/unix_domain_client_socket_posix_unittest.cc',
762               'socket/unix_domain_listen_socket_posix_unittest.cc',
763               'socket/unix_domain_server_socket_posix_unittest.cc',
765               # See bug http://crbug.com/344533.
766               'disk_cache/blockfile/index_table_v3_unittest.cc',
767             ],
768         }],
769         [ 'OS == "android"', {
770             'sources!': [
771               'dns/dns_config_service_posix_unittest.cc',
772             ],
773           },
774         ],
775         ['OS == "android"', {
776           # TODO(mmenke):  This depends on test_support_base, which depends on
777           #                icu.  Figure out a way to remove that dependency.
778           'dependencies': [
779             '../testing/android/native_test.gyp:native_test_native_code',
780           ]
781         }],
782         [ 'use_icu_alternatives_on_android == 1', {
783             'dependencies!': [
784               '../base/base.gyp:base_i18n',
785             ],
786             'sources!': [
787               'base/filename_util_unittest.cc',
788               'base/net_util_icu_unittest.cc',
789             ],
790           },
791         ],
792       ],
793       'target_conditions': [
794         # These source files are excluded by default platform rules, but they
795         # are needed in specific cases on other platforms. Re-including them can
796         # only be done in target_conditions as it is evaluated after the
797         # platform rules.
798         ['OS == "android"', {
799           'sources/': [
800             ['include', '^base/address_tracker_linux_unittest\\.cc$'],
801           ],
802         }],
803       ],
804     },
805     {
806       'target_name': 'net_perftests',
807       'type': 'executable',
808       'dependencies': [
809         '../base/base.gyp:base',
810         '../base/base.gyp:base_i18n',
811         '../base/base.gyp:test_support_perf',
812         '../testing/gtest.gyp:gtest',
813         '../url/url.gyp:url_lib',
814         'net',
815         'net_test_support',
816       ],
817       'sources': [
818         'cookies/cookie_monster_perftest.cc',
819         'disk_cache/blockfile/disk_cache_perftest.cc',
820         'proxy/proxy_resolver_perftest.cc',
821         'websockets/websocket_frame_perftest.cc',
822       ],
823       'conditions': [
824         [ 'use_v8_in_net==1', {
825             'dependencies': [
826               'net_with_v8',
827             ],
828           }, {  # else: !use_v8_in_net
829             'sources!': [
830               'proxy/proxy_resolver_perftest.cc',
831             ],
832           },
833         ],
834         [ 'OS == "win"', {
835             'conditions': [
836               [ 'icu_use_data_file_flag == 0', {
837                 # This is needed to trigger the dll copy step on windows.
838                 # TODO(mark): Specifying this here shouldn't be necessary.
839                 'dependencies': [
840                   '../third_party/icu/icu.gyp:icudata',
841                 ],
842               }],
843             ],
844             # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
845             'msvs_disabled_warnings': [4267, ],
846         }],
847         [ 'enable_websockets != 1', {
848           'sources!': [
849             'websockets/websocket_frame_perftest.cc',
850           ],
851         }],
852       ],
853     },
854     {
855       'target_name': 'net_test_support',
856       'type': 'static_library',
857       'dependencies': [
858         '../base/base.gyp:base',
859         '../base/base.gyp:test_support_base',
860         '../net/tools/tld_cleanup/tld_cleanup.gyp:tld_cleanup_util',
861         '../testing/gtest.gyp:gtest',
862         '../testing/gmock.gyp:gmock',
863         '../url/url.gyp:url_lib',
864         'net',
865       ],
866       'export_dependent_settings': [
867         '../base/base.gyp:base',
868         # TODO(mmenke):  This depends on icu, figure out a way to build tests
869         #                without icu.
870         '../base/base.gyp:test_support_base',
871         '../testing/gtest.gyp:gtest',
872         '../testing/gmock.gyp:gmock',
873       ],
874       'sources': [
875         'base/capturing_net_log.cc',
876         'base/capturing_net_log.h',
877         'base/load_timing_info_test_util.cc',
878         'base/load_timing_info_test_util.h',
879         'base/mock_file_stream.cc',
880         'base/mock_file_stream.h',
881         'base/test_completion_callback.cc',
882         'base/test_completion_callback.h',
883         'base/test_data_directory.cc',
884         'base/test_data_directory.h',
885         'cert/mock_cert_verifier.cc',
886         'cert/mock_cert_verifier.h',
887         'cookies/cookie_monster_store_test.cc',
888         'cookies/cookie_monster_store_test.h',
889         'cookies/cookie_store_test_callbacks.cc',
890         'cookies/cookie_store_test_callbacks.h',
891         'cookies/cookie_store_test_helpers.cc',
892         'cookies/cookie_store_test_helpers.h',
893         'disk_cache/disk_cache_test_base.cc',
894         'disk_cache/disk_cache_test_base.h',
895         'disk_cache/disk_cache_test_util.cc',
896         'disk_cache/disk_cache_test_util.h',
897         'dns/dns_test_util.cc',
898         'dns/dns_test_util.h',
899         'dns/mock_host_resolver.cc',
900         'dns/mock_host_resolver.h',
901         'dns/mock_mdns_socket_factory.cc',
902         'dns/mock_mdns_socket_factory.h',
903         'http/http_transaction_test_util.cc',
904         'http/http_transaction_test_util.h',
905         'proxy/mock_proxy_resolver.cc',
906         'proxy/mock_proxy_resolver.h',
907         'proxy/mock_proxy_script_fetcher.cc',
908         'proxy/mock_proxy_script_fetcher.h',
909         'proxy/proxy_config_service_common_unittest.cc',
910         'proxy/proxy_config_service_common_unittest.h',
911         'socket/socket_test_util.cc',
912         'socket/socket_test_util.h',
913         'test/cert_test_util.cc',
914         'test/cert_test_util.h',
915         'test/cert_test_util_nss.cc',
916         'test/ct_test_util.cc',
917         'test/ct_test_util.h',
918         'test/embedded_test_server/embedded_test_server.cc',
919         'test/embedded_test_server/embedded_test_server.h',
920         'test/embedded_test_server/http_connection.cc',
921         'test/embedded_test_server/http_connection.h',
922         'test/embedded_test_server/http_request.cc',
923         'test/embedded_test_server/http_request.h',
924         'test/embedded_test_server/http_response.cc',
925         'test/embedded_test_server/http_response.h',
926         'test/net_test_suite.cc',
927         'test/net_test_suite.h',
928         'test/python_utils.cc',
929         'test/python_utils.h',
930         'test/spawned_test_server/base_test_server.cc',
931         'test/spawned_test_server/base_test_server.h',
932         'test/spawned_test_server/local_test_server_posix.cc',
933         'test/spawned_test_server/local_test_server_win.cc',
934         'test/spawned_test_server/local_test_server.cc',
935         'test/spawned_test_server/local_test_server.h',
936         'test/spawned_test_server/remote_test_server.cc',
937         'test/spawned_test_server/remote_test_server.h',
938         'test/spawned_test_server/spawned_test_server.h',
939         'test/spawned_test_server/spawner_communicator.cc',
940         'test/spawned_test_server/spawner_communicator.h',
941         'test/url_request/url_request_failed_job.cc',
942         'test/url_request/url_request_failed_job.h',
943         'test/url_request/url_request_mock_http_job.cc',
944         'test/url_request/url_request_mock_http_job.h',
945         'url_request/test_url_fetcher_factory.cc',
946         'url_request/test_url_fetcher_factory.h',
947         'url_request/test_url_request_interceptor.cc',
948         'url_request/test_url_request_interceptor.h',
949         'url_request/url_request_test_util.cc',
950         'url_request/url_request_test_util.h',
951       ],
952       'conditions': [
953         ['OS != "ios"', {
954           'dependencies': [
955             '../third_party/protobuf/protobuf.gyp:py_proto',
956           ],
957         }],
958         ['use_openssl == 0 and (use_nss == 1 or OS == "ios")', {
959           'conditions': [
960             [ 'desktop_linux == 1 or chromeos == 1', {
961               'dependencies': [
962                 '../build/linux/system.gyp:ssl',
963               ],
964             }, {  # desktop_linux == 0 and chromeos == 0
965               'dependencies': [
966                 '../third_party/nss/nss.gyp:nspr',
967                 '../third_party/nss/nss.gyp:nss',
968                 'third_party/nss/ssl.gyp:libssl',
969               ],
970             }],
971           ],
972           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
973           'msvs_disabled_warnings': [4267, ],
974         }],
975         ['os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
976           'conditions': [
977             ['use_allocator!="none"', {
978               'dependencies': [
979                 '../base/allocator/allocator.gyp:allocator',
980               ],
981             }],
982           ],
983         }],
984         ['OS != "android"', {
985           'sources!': [
986             'test/spawned_test_server/remote_test_server.cc',
987             'test/spawned_test_server/remote_test_server.h',
988             'test/spawned_test_server/spawner_communicator.cc',
989             'test/spawned_test_server/spawner_communicator.h',
990           ],
991         }],
992         [ 'use_v8_in_net==1', {
993             'dependencies': [
994               'net_with_v8',
995             ],
996           },
997         ],
998         [ 'enable_mdns != 1', {
999             'sources!' : [
1000               'dns/mock_mdns_socket_factory.cc',
1001               'dns/mock_mdns_socket_factory.h'
1002             ]
1003         }],
1004         [ 'use_nss != 1', {
1005             'sources!': [
1006               'test/cert_test_util_nss.cc',
1007             ],
1008         }],
1009       ],
1010       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1011       'msvs_disabled_warnings': [4267, ],
1012     },
1013     {
1014       'target_name': 'net_resources',
1015       'type': 'none',
1016       'variables': {
1017         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/net',
1018       },
1019       'actions': [
1020         {
1021           'action_name': 'net_resources',
1022           'variables': {
1023             'grit_grd_file': 'base/net_resources.grd',
1024           },
1025           'includes': [ '../build/grit_action.gypi' ],
1026         },
1027       ],
1028     },
1029     {
1030       'target_name': 'net_extras',
1031       'type': 'static_library',
1032       'variables': { 'enable_wexit_time_destructors': 1, },
1033       'dependencies': [
1034         '../base/base.gyp:base',
1035         '../sql/sql.gyp:sql',
1036         'net',
1037       ],
1038       'sources': [
1039         '<@(net_extras_sources)',
1040       ],
1041     },
1042     {
1043       'target_name': 'http_server',
1044       'type': 'static_library',
1045       'variables': { 'enable_wexit_time_destructors': 1, },
1046       'dependencies': [
1047         '../base/base.gyp:base',
1048         'net',
1049       ],
1050       'sources': [
1051         'server/http_connection.cc',
1052         'server/http_connection.h',
1053         'server/http_server.cc',
1054         'server/http_server.h',
1055         'server/http_server_request_info.cc',
1056         'server/http_server_request_info.h',
1057         'server/http_server_response_info.cc',
1058         'server/http_server_response_info.h',
1059         'server/web_socket.cc',
1060         'server/web_socket.h',
1061       ],
1062       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1063       'msvs_disabled_warnings': [4267, ],
1064     },
1065     {
1066       'target_name': 'balsa',
1067       'type': 'static_library',
1068       'dependencies': [
1069         '../base/base.gyp:base',
1070         'net',
1071       ],
1072       'sources': [
1073         'tools/balsa/balsa_enums.h',
1074         'tools/balsa/balsa_frame.cc',
1075         'tools/balsa/balsa_frame.h',
1076         'tools/balsa/balsa_headers.cc',
1077         'tools/balsa/balsa_headers.h',
1078         'tools/balsa/balsa_headers_token_utils.cc',
1079         'tools/balsa/balsa_headers_token_utils.h',
1080         'tools/balsa/balsa_visitor_interface.h',
1081         'tools/balsa/http_message_constants.cc',
1082         'tools/balsa/http_message_constants.h',
1083         'tools/balsa/noop_balsa_visitor.h',
1084         'tools/balsa/simple_buffer.cc',
1085         'tools/balsa/simple_buffer.h',
1086         'tools/balsa/split.cc',
1087         'tools/balsa/split.h',
1088         'tools/balsa/string_piece_utils.h',
1089         'tools/quic/spdy_utils.cc',
1090         'tools/quic/spdy_utils.h',
1091       ],
1092     },
1093     {
1094       'target_name': 'dump_cache',
1095       'type': 'executable',
1096       'dependencies': [
1097         '../base/base.gyp:base',
1098         'net',
1099         'net_test_support',
1100       ],
1101       'sources': [
1102         'tools/dump_cache/cache_dumper.cc',
1103         'tools/dump_cache/cache_dumper.h',
1104         'tools/dump_cache/dump_cache.cc',
1105         'tools/dump_cache/dump_files.cc',
1106         'tools/dump_cache/dump_files.h',
1107         'tools/dump_cache/simple_cache_dumper.cc',
1108         'tools/dump_cache/simple_cache_dumper.h',
1109         'tools/dump_cache/url_to_filename_encoder.cc',
1110         'tools/dump_cache/url_to_filename_encoder.h',
1111         'tools/dump_cache/url_utilities.h',
1112         'tools/dump_cache/url_utilities.cc',
1113       ],
1114       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1115       'msvs_disabled_warnings': [4267, ],
1116     },
1117     {
1118       # This is a temporary target which will be merged into 'net' once the
1119       # dependency on balsa is eliminated and the classes are actually used.
1120       'target_name': 'quic_tools',
1121       'type': 'static_library',
1122       'dependencies': [
1123         '../base/base.gyp:base',
1124         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
1125         '../url/url.gyp:url_lib',
1126         'net',
1127       ],
1128       'sources': [
1129         'quic/quic_dispatcher.cc',
1130         'quic/quic_dispatcher.h',
1131         'quic/quic_in_memory_cache.cc',
1132         'quic/quic_in_memory_cache.h',
1133         'quic/quic_per_connection_packet_writer.cc',
1134         'quic/quic_per_connection_packet_writer.h',
1135         'quic/quic_server.cc',
1136         'quic/quic_server.h',
1137         'quic/quic_server_packet_writer.cc',
1138         'quic/quic_server_packet_writer.h',
1139         'quic/quic_server_session.cc',
1140         'quic/quic_server_session.h',
1141         'quic/quic_spdy_server_stream.cc',
1142         'quic/quic_spdy_server_stream.h',
1143         'quic/quic_time_wait_list_manager.cc',
1144         'quic/quic_time_wait_list_manager.h',
1145       ],
1146     },
1147   ],
1148   'conditions': [
1149     ['use_v8_in_net == 1', {
1150       'targets': [
1151         {
1152           'target_name': 'net_with_v8',
1153           'type': '<(component)',
1154           'variables': { 'enable_wexit_time_destructors': 1, },
1155           'dependencies': [
1156             '../base/base.gyp:base',
1157             '../gin/gin.gyp:gin',
1158             '../url/url.gyp:url_lib',
1159             '../v8/tools/gyp/v8.gyp:v8',
1160             'net'
1161           ],
1162           'defines': [
1163             'NET_IMPLEMENTATION',
1164           ],
1165           'sources': [
1166             'proxy/proxy_resolver_v8.cc',
1167             'proxy/proxy_resolver_v8.h',
1168             'proxy/proxy_resolver_v8_tracing.cc',
1169             'proxy/proxy_resolver_v8_tracing.h',
1170             'proxy/proxy_service_v8.cc',
1171             'proxy/proxy_service_v8.h',
1172           ],
1173           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1174           'msvs_disabled_warnings': [4267, ],
1175         },
1176       ],
1177     }],
1178     ['OS != "ios" and OS != "android"', {
1179       'targets': [
1180         # iOS doesn't have the concept of simple executables, these targets
1181         # can't be compiled on the platform.
1182         {
1183           'target_name': 'crash_cache',
1184           'type': 'executable',
1185           'dependencies': [
1186             '../base/base.gyp:base',
1187             'net',
1188             'net_test_support',
1189           ],
1190           'sources': [
1191             'tools/crash_cache/crash_cache.cc',
1192           ],
1193           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1194           'msvs_disabled_warnings': [4267, ],
1195         },
1196         {
1197           'target_name': 'crl_set_dump',
1198           'type': 'executable',
1199           'dependencies': [
1200             '../base/base.gyp:base',
1201             'net',
1202           ],
1203           'sources': [
1204             'tools/crl_set_dump/crl_set_dump.cc',
1205           ],
1206           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1207           'msvs_disabled_warnings': [4267, ],
1208         },
1209         {
1210           'target_name': 'dns_fuzz_stub',
1211           'type': 'executable',
1212           'dependencies': [
1213             '../base/base.gyp:base',
1214             'net',
1215           ],
1216           'sources': [
1217             'tools/dns_fuzz_stub/dns_fuzz_stub.cc',
1218           ],
1219           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1220           'msvs_disabled_warnings': [4267, ],
1221         },
1222         {
1223           'target_name': 'gdig',
1224           'type': 'executable',
1225           'dependencies': [
1226             '../base/base.gyp:base',
1227             'net',
1228           ],
1229           'sources': [
1230             'tools/gdig/file_net_log.cc',
1231             'tools/gdig/gdig.cc',
1232           ],
1233         },
1234         {
1235           'target_name': 'get_server_time',
1236           'type': 'executable',
1237           'dependencies': [
1238             '../base/base.gyp:base',
1239             '../base/base.gyp:base_i18n',
1240             '../url/url.gyp:url_lib',
1241             'net',
1242           ],
1243           'sources': [
1244             'tools/get_server_time/get_server_time.cc',
1245           ],
1246           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1247           'msvs_disabled_warnings': [4267, ],
1248         },
1249         {
1250           'target_name': 'hpack_example_generator',
1251           'type': 'executable',
1252           'dependencies': [
1253             '../base/base.gyp:base',
1254             'net',
1255           ],
1256           'sources': [
1257             'spdy/fuzzing/hpack_example_generator.cc',
1258           ],
1259           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1260           'msvs_disabled_warnings': [4267, ],
1261         },
1262         {
1263           'target_name': 'hpack_fuzz_mutator',
1264           'type': 'executable',
1265           'dependencies': [
1266             '../base/base.gyp:base',
1267             'net',
1268           ],
1269           'sources': [
1270             'spdy/fuzzing/hpack_fuzz_mutator.cc',
1271           ],
1272           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1273           'msvs_disabled_warnings': [4267, ],
1274         },
1275         {
1276           'target_name': 'hpack_fuzz_wrapper',
1277           'type': 'executable',
1278           'dependencies': [
1279             '../base/base.gyp:base',
1280             'net',
1281           ],
1282           'sources': [
1283             'spdy/fuzzing/hpack_fuzz_wrapper.cc',
1284           ],
1285           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1286           'msvs_disabled_warnings': [4267, ],
1287         },
1288         {
1289           'target_name': 'net_watcher',
1290           'type': 'executable',
1291           'dependencies': [
1292             '../base/base.gyp:base',
1293             'net',
1294             'net_with_v8',
1295           ],
1296           'conditions': [
1297             [ 'use_glib == 1', {
1298                 'dependencies': [
1299                   '../build/linux/system.gyp:gconf',
1300                   '../build/linux/system.gyp:gio',
1301                 ],
1302               },
1303             ],
1304           ],
1305           'sources': [
1306             'tools/net_watcher/net_watcher.cc',
1307           ],
1308         },
1309         {
1310           'target_name': 'run_testserver',
1311           'type': 'executable',
1312           'dependencies': [
1313             '../base/base.gyp:base',
1314             '../base/base.gyp:test_support_base',
1315             '../testing/gtest.gyp:gtest',
1316             'net_test_support',
1317           ],
1318           'sources': [
1319             'tools/testserver/run_testserver.cc',
1320           ],
1321         },
1322         {
1323           'target_name': 'stress_cache',
1324           'type': 'executable',
1325           'dependencies': [
1326             '../base/base.gyp:base',
1327             'net',
1328             'net_test_support',
1329           ],
1330           'sources': [
1331             'disk_cache/blockfile/stress_cache.cc',
1332           ],
1333           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1334           'msvs_disabled_warnings': [4267, ],
1335         },
1336         {
1337           'target_name': 'tld_cleanup',
1338           'type': 'executable',
1339           'dependencies': [
1340             '../base/base.gyp:base',
1341             '../base/base.gyp:base_i18n',
1342             '../net/tools/tld_cleanup/tld_cleanup.gyp:tld_cleanup_util',
1343           ],
1344           'sources': [
1345             'tools/tld_cleanup/tld_cleanup.cc',
1346           ],
1347           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1348           'msvs_disabled_warnings': [4267, ],
1349         },
1350       ],
1351     }],
1352     ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
1353       'targets': [
1354         {
1355           'target_name': 'epoll_server',
1356           'type': 'static_library',
1357           'dependencies': [
1358             '../base/base.gyp:base',
1359             'net',
1360           ],
1361           'sources': [
1362             'tools/epoll_server/epoll_server.cc',
1363             'tools/epoll_server/epoll_server.h',
1364           ],
1365         },
1366         {
1367           'target_name': 'flip_in_mem_edsm_server_base',
1368           'type': 'static_library',
1369           'cflags': [
1370             '-Wno-deprecated',
1371           ],
1372           'dependencies': [
1373             '../base/base.gyp:base',
1374             '../third_party/boringssl/boringssl.gyp:boringssl',
1375             'balsa',
1376             'epoll_server',
1377             'net',
1378           ],
1379           'sources': [
1380             'tools/dump_cache/url_to_filename_encoder.cc',
1381             'tools/dump_cache/url_to_filename_encoder.h',
1382             'tools/dump_cache/url_utilities.h',
1383             'tools/dump_cache/url_utilities.cc',
1384             'tools/flip_server/acceptor_thread.h',
1385             'tools/flip_server/acceptor_thread.cc',
1386             'tools/flip_server/create_listener.cc',
1387             'tools/flip_server/create_listener.h',
1388             'tools/flip_server/constants.h',
1389             'tools/flip_server/flip_config.cc',
1390             'tools/flip_server/flip_config.h',
1391             'tools/flip_server/http_interface.cc',
1392             'tools/flip_server/http_interface.h',
1393             'tools/flip_server/loadtime_measurement.h',
1394             'tools/flip_server/mem_cache.h',
1395             'tools/flip_server/mem_cache.cc',
1396             'tools/flip_server/output_ordering.cc',
1397             'tools/flip_server/output_ordering.h',
1398             'tools/flip_server/ring_buffer.cc',
1399             'tools/flip_server/ring_buffer.h',
1400             'tools/flip_server/sm_connection.cc',
1401             'tools/flip_server/sm_connection.h',
1402             'tools/flip_server/sm_interface.h',
1403             'tools/flip_server/spdy_ssl.cc',
1404             'tools/flip_server/spdy_ssl.h',
1405             'tools/flip_server/spdy_interface.cc',
1406             'tools/flip_server/spdy_interface.h',
1407             'tools/flip_server/spdy_util.cc',
1408             'tools/flip_server/spdy_util.h',
1409             'tools/flip_server/streamer_interface.cc',
1410             'tools/flip_server/streamer_interface.h',
1411           ],
1412         },
1413         {
1414           'target_name': 'flip_in_mem_edsm_server_unittests',
1415           'type': 'executable',
1416           'dependencies': [
1417               '../testing/gtest.gyp:gtest',
1418               '../testing/gmock.gyp:gmock',
1419               '../third_party/boringssl/boringssl.gyp:boringssl',
1420               'flip_in_mem_edsm_server_base',
1421               'net',
1422               'net_test_support',
1423           ],
1424           'sources': [
1425             'tools/flip_server/flip_test_utils.cc',
1426             'tools/flip_server/flip_test_utils.h',
1427             'tools/flip_server/http_interface_test.cc',
1428             'tools/flip_server/mem_cache_test.cc',
1429             'tools/flip_server/run_all_tests.cc',
1430             'tools/flip_server/spdy_interface_test.cc',
1431           ],
1432         },
1433         {
1434           'target_name': 'flip_in_mem_edsm_server',
1435           'type': 'executable',
1436           'cflags': [
1437             '-Wno-deprecated',
1438           ],
1439           'dependencies': [
1440             '../base/base.gyp:base',
1441             'flip_in_mem_edsm_server_base',
1442             'net',
1443           ],
1444           'sources': [
1445             'tools/flip_server/flip_in_mem_edsm_server.cc',
1446           ],
1447         },
1448         {
1449           'target_name': 'quic_base',
1450           'type': 'static_library',
1451           'dependencies': [
1452             '../base/base.gyp:base',
1453             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
1454             '../url/url.gyp:url_lib',
1455             'balsa',
1456             'epoll_server',
1457             'net',
1458           ],
1459           'sources': [
1460             'tools/quic/quic_client.cc',
1461             'tools/quic/quic_client.h',
1462             'tools/quic/quic_client_session.cc',
1463             'tools/quic/quic_client_session.h',
1464             'tools/quic/quic_default_packet_writer.cc',
1465             'tools/quic/quic_default_packet_writer.h',
1466             'tools/quic/quic_dispatcher.h',
1467             'tools/quic/quic_dispatcher.cc',
1468             'tools/quic/quic_epoll_clock.cc',
1469             'tools/quic/quic_epoll_clock.h',
1470             'tools/quic/quic_epoll_connection_helper.cc',
1471             'tools/quic/quic_epoll_connection_helper.h',
1472             'tools/quic/quic_in_memory_cache.cc',
1473             'tools/quic/quic_in_memory_cache.h',
1474             'tools/quic/quic_packet_writer_wrapper.cc',
1475             'tools/quic/quic_packet_writer_wrapper.h',
1476             'tools/quic/quic_per_connection_packet_writer.cc',
1477             'tools/quic/quic_per_connection_packet_writer.h',
1478             'tools/quic/quic_server.cc',
1479             'tools/quic/quic_server.h',
1480             'tools/quic/quic_server_session.cc',
1481             'tools/quic/quic_server_session.h',
1482             'tools/quic/quic_socket_utils.cc',
1483             'tools/quic/quic_socket_utils.h',
1484             'tools/quic/quic_spdy_client_stream.cc',
1485             'tools/quic/quic_spdy_client_stream.h',
1486             'tools/quic/quic_spdy_server_stream.cc',
1487             'tools/quic/quic_spdy_server_stream.h',
1488             'tools/quic/quic_time_wait_list_manager.h',
1489             'tools/quic/quic_time_wait_list_manager.cc',
1490           ],
1491         },
1492         {
1493           'target_name': 'quic_client',
1494           'type': 'executable',
1495           'dependencies': [
1496             '../base/base.gyp:base',
1497             'net',
1498             'quic_base',
1499           ],
1500           'sources': [
1501             'tools/quic/quic_client_bin.cc',
1502           ],
1503         },
1504         {
1505           'target_name': 'quic_server',
1506           'type': 'executable',
1507           'dependencies': [
1508             '../base/base.gyp:base',
1509             'net',
1510             'quic_tools',
1511           ],
1512           'sources': [
1513             'quic/quic_server_bin.cc',
1514           ],
1515         },
1516       ]
1517     }],
1518     ['OS=="android"', {
1519       'targets': [
1520         {
1521           'target_name': 'net_jni_headers',
1522           'type': 'none',
1523           'sources': [
1524             'android/java/src/org/chromium/net/AndroidCertVerifyResult.java',
1525             'android/java/src/org/chromium/net/AndroidKeyStore.java',
1526             'android/java/src/org/chromium/net/AndroidNetworkLibrary.java',
1527             'android/java/src/org/chromium/net/AndroidPrivateKey.java',
1528             'android/java/src/org/chromium/net/GURLUtils.java',
1529             'android/java/src/org/chromium/net/NetworkChangeNotifier.java',
1530             'android/java/src/org/chromium/net/ProxyChangeListener.java',
1531             'android/java/src/org/chromium/net/X509Util.java',
1532           ],
1533           'variables': {
1534             'jni_gen_package': 'net',
1535           },
1536           'includes': [ '../build/jni_generator.gypi' ],
1538           'conditions': [
1539             ['use_icu_alternatives_on_android==1', {
1540               'sources': [
1541                 'android/java/src/org/chromium/net/NetStringUtil.java',
1542               ],
1543             }],
1544           ],
1545         },
1546         {
1547           'target_name': 'net_test_jni_headers',
1548           'type': 'none',
1549           'sources': [
1550             'android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java',
1551           ],
1552           'variables': {
1553             'jni_gen_package': 'net',
1554           },
1555           'includes': [ '../build/jni_generator.gypi' ],
1556         },
1557         {
1558           'target_name': 'net_java',
1559           'type': 'none',
1560           'variables': {
1561             'java_in_dir': '../net/android/java',
1562           },
1563           'dependencies': [
1564             '../base/base.gyp:base',
1565             'cert_verify_status_android_java',
1566             'certificate_mime_types_java',
1567             'net_errors_java',
1568             'private_key_types_java',
1569             'remote_android_keystore_aidl',
1570           ],
1571           'includes': [ '../build/java.gypi' ],
1572         },
1573         {
1574           # Processes the interface files for communication with an Android KeyStore
1575           # running in a separate process.
1576           'target_name': 'remote_android_keystore_aidl',
1577           'type': 'none',
1578           'variables': {
1579             'aidl_interface_file': '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStoreInterface.aidl',
1580           },
1581           'sources': [
1582             '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStore.aidl',
1583             '../net/android/java/src/org/chromium/net/IRemoteAndroidKeyStoreCallbacks.aidl',
1584           ],
1585           'includes': [ '../build/java_aidl.gypi' ],
1586         },
1587         {
1588           'target_name': 'net_java_test_support',
1589           'type': 'none',
1590           'variables': {
1591             'java_in_dir': '../net/test/android/javatests',
1592           },
1593           'includes': [ '../build/java.gypi' ],
1594         },
1595         {
1596           'target_name': 'net_javatests',
1597           'type': 'none',
1598           'variables': {
1599             'java_in_dir': '../net/android/javatests',
1600           },
1601           'dependencies': [
1602             '../base/base.gyp:base',
1603             '../base/base.gyp:base_java_test_support',
1604             'net_java',
1605           ],
1606           'includes': [ '../build/java.gypi' ],
1607         },
1608         {
1609           'target_name': 'net_errors_java',
1610           'type': 'none',
1611           'sources': [
1612             'android/java/NetError.template',
1613           ],
1614           'variables': {
1615             'package_name': 'org/chromium/net',
1616             'template_deps': ['base/net_error_list.h'],
1617           },
1618           'includes': [ '../build/android/java_cpp_template.gypi' ],
1619         },
1620         {
1621           'target_name': 'certificate_mime_types_java',
1622           'type': 'none',
1623           'variables': {
1624             'source_file': 'base/mime_util.h',
1625           },
1626           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1627         },
1628         {
1629           'target_name': 'cert_verify_status_android_java',
1630           'type': 'none',
1631           'variables': {
1632             'source_file': 'android/cert_verify_result_android.h',
1633           },
1634           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1635         },
1636         {
1637           'target_name': 'private_key_types_java',
1638           'type': 'none',
1639           'variables': {
1640             'source_file': 'android/keystore.h',
1641           },
1642           'includes': [ '../build/android/java_cpp_enum.gypi' ],
1643         },
1644         {
1645           'target_name': 'net_unittests_apk',
1646           'type': 'none',
1647           'dependencies': [
1648             'net_java',
1649             'net_javatests',
1650             'net_unittests',
1651           ],
1652           'variables': {
1653             'test_suite_name': 'net_unittests',
1654           },
1655           'includes': [ '../build/apk_test.gypi' ],
1656         },
1657       ],
1658     }],
1659     ['OS == "android" or OS == "linux"', {
1660       'targets': [
1661         {
1662           'target_name': 'disk_cache_memory_test',
1663           'type': 'executable',
1664           'dependencies': [
1665             '../base/base.gyp:base',
1666             'net',
1667           ],
1668           'sources': [
1669             'tools/disk_cache_memory_test/disk_cache_memory_test.cc',
1670           ],
1671         },
1672       ],
1673     }],
1674     ['test_isolation_mode != "noop"', {
1675       'targets': [
1676         {
1677           'target_name': 'net_unittests_run',
1678           'type': 'none',
1679           'dependencies': [
1680             'net_unittests',
1681           ],
1682           'includes': [
1683             '../build/isolate.gypi',
1684           ],
1685           'sources': [
1686             'net_unittests.isolate',
1687           ],
1688         },
1689       ],
1690     }],
1691   ],