Add synthetic delay testing framework
[chromium-blink-merge.git] / base / base.gyp
blob7c2b54d8a872b5cc19a43a3c9ff3f1343c0eae2c
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6   'variables': {
7     'chromium_code': 1,
8   },
9   'includes': [
10     '../build/win_precompile.gypi',
11     'base.gypi',
12   ],
13   'targets': [
14     {
15       'target_name': 'base',
16       'type': '<(component)',
17       'toolsets': ['host', 'target'],
18       'variables': {
19         'base_target': 1,
20         'enable_wexit_time_destructors': 1,
21         'optimize': 'max',
22       },
23       'dependencies': [
24         'base_static',
25         'allocator/allocator.gyp:allocator_extension_thunks',
26         '../testing/gtest.gyp:gtest_prod',
27         '../third_party/modp_b64/modp_b64.gyp:modp_b64',
28         'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
29       ],
30       # TODO(gregoryd): direct_dependent_settings should be shared with the
31       #  64-bit target, but it doesn't work due to a bug in gyp
32       'direct_dependent_settings': {
33         'include_dirs': [
34           '..',
35         ],
36       },
37       'conditions': [
38         ['desktop_linux == 1 or chromeos == 1', {
39           'conditions': [
40             ['chromeos==1', {
41               'sources/': [ ['include', '_chromeos\\.cc$'] ]
42             }],
43             ['toolkit_uses_gtk==1', {
44               'dependencies': [
45                 '../build/linux/system.gyp:gtk',
46               ],
47               'export_dependent_settings': [
48                 '../build/linux/system.gyp:gtk',
49               ],
50             }],
51           ],
52           'dependencies': [
53             'symbolize',
54             'xdg_mime',
55           ],
56           'defines': [
57             'USE_SYMBOLIZE',
58           ],
59           'cflags': [
60             '-Wno-write-strings',
61           ],
62         }, {  # desktop_linux == 0 and chromeos == 0
63             'sources/': [
64               ['exclude', '/xdg_user_dirs/'],
65               ['exclude', '_nss\\.cc$'],
66             ],
67         }],
68         ['use_glib==1', {
69           'dependencies': [
70             '../build/linux/system.gyp:glib',
71           ],
72           'export_dependent_settings': [
73             '../build/linux/system.gyp:glib',
74           ],
75         }],
76         ['use_x11==1', {
77           'dependencies': [
78             '../build/linux/system.gyp:x11',
79           ],
80           'export_dependent_settings': [
81             '../build/linux/system.gyp:x11',
82           ],
83         }],
84         ['use_aura==1 and use_x11==1', {
85           'dependencies': [
86             '../build/linux/system.gyp:xrandr',
87           ],
88           'export_dependent_settings': [
89             '../build/linux/system.gyp:xrandr',
90           ],
91         }],
92         ['OS == "android" and _toolset == "host"', {
93           # Always build base as a static_library for host toolset, even if
94           # we're doing a component build. Specifically, we only care about the
95           # target toolset using components since that's what developers are
96           # focusing on. In theory we should do this more generally for all
97           # targets when building for host, but getting the gyp magic
98           # per-toolset for the "component" variable is hard, and we really only
99           # need base on host.
100           'type': 'static_library',
101           # Base for host support is the minimum required to run the
102           # ssl false start blacklist tool. It requires further changes
103           # to generically support host builds (and tests).
104           # Note: when building for host, gyp has OS == "android",
105           # hence the *_android.cc files are included but the actual code
106           # doesn't have OS_ANDROID / ANDROID defined.
107           'conditions': [
108             # Host build on linux depends on system.gyp::gtk as
109             # default linux build has TOOLKIT_GTK defined.
110             ['host_os == "linux"', {
111               'sources/': [
112                 ['include', '^atomicops_internals_x86_gcc\\.cc$'],
113               ],
114               'dependencies': [
115                 '../build/linux/system.gyp:gtk',
116               ],
117               'export_dependent_settings': [
118                 '../build/linux/system.gyp:gtk',
119               ],
120             }],
121             ['host_os == "mac"', {
122               'sources/': [
123                 ['exclude', '^native_library_linux\\.cc$'],
124                 ['exclude', '^process_util_linux\\.cc$'],
125                 ['exclude', '^sys_info_linux\\.cc$'],
126                 ['exclude', '^sys_string_conversions_linux\\.cc$'],
127                 ['exclude', '^worker_pool_linux\\.cc$'],
128               ],
129             }],
130           ],
131         }],
132         ['OS == "android" and _toolset == "target"', {
133           'conditions': [
134             ['target_arch == "ia32"', {
135               'sources/': [
136                 ['include', '^atomicops_internals_x86_gcc\\.cc$'],
137               ],
138             }],
139             ['target_arch == "mipsel"', {
140               'sources/': [
141                 ['include', '^atomicops_internals_mips_gcc\\.cc$'],
142               ],
143             }],
144           ],
145           'dependencies': [
146             'base_jni_headers',
147             '../third_party/ashmem/ashmem.gyp:ashmem',
148           ],
149           'link_settings': {
150             'libraries': [
151               '-llog',
152             ],
153           },
154           'sources!': [
155             'debug/stack_trace_posix.cc',
156           ],
157           'includes': [
158             '../build/android/cpufeatures.gypi',
159           ],
160         }],
161         ['OS == "android" and _toolset == "target" and android_webview_build == 0', {
162           'dependencies': [
163             'base_java',
164           ],
165         }],
166         ['os_bsd==1', {
167           'include_dirs': [
168             '/usr/local/include',
169           ],
170           'link_settings': {
171             'libraries': [
172               '-L/usr/local/lib -lexecinfo',
173             ],
174           },
175         }],
176         ['OS == "linux"', {
177           'link_settings': {
178             'libraries': [
179               # We need rt for clock_gettime().
180               '-lrt',
181               # For 'native_library_linux.cc'
182               '-ldl',
183             ],
184           },
185           'conditions': [
186             ['linux_use_tcmalloc==0', {
187               'defines': [
188                 'NO_TCMALLOC',
189               ],
190               'direct_dependent_settings': {
191                 'defines': [
192                   'NO_TCMALLOC',
193                 ],
194               },
195             }],
196           ],
197         }],
198         ['OS == "mac" or (OS == "ios" and _toolset == "host")', {
199           'link_settings': {
200             'libraries': [
201               '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
202               '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework',
203               '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
204               '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
205               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
206               '$(SDKROOT)/System/Library/Frameworks/IOKit.framework',
207               '$(SDKROOT)/System/Library/Frameworks/Security.framework',
208             ],
209           },
210           'dependencies': [
211             '../third_party/mach_override/mach_override.gyp:mach_override',
212           ],
213         }],
214         ['OS == "ios" and _toolset != "host"', {
215           'link_settings': {
216             'libraries': [
217               '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
218               '$(SDKROOT)/System/Library/Frameworks/CoreGraphics.framework',
219               '$(SDKROOT)/System/Library/Frameworks/CoreText.framework',
220               '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
221               '$(SDKROOT)/System/Library/Frameworks/UIKit.framework',
222             ],
223           },
224         }],
225         ['OS != "win" and OS != "ios"', {
226             'dependencies': ['../third_party/libevent/libevent.gyp:libevent'],
227         },],
228         ['component=="shared_library"', {
229           'conditions': [
230             ['OS=="win"', {
231               'sources!': [
232                 'debug/debug_on_start_win.cc',
233               ],
234             }],
235           ],
236         }],
237         ['use_system_nspr==1', {
238           'dependencies': [
239             'third_party/nspr/nspr.gyp:nspr',
240           ],
241         }],
242       ],
243       'sources': [
244         'third_party/nspr/prcpucfg.h',
245         'third_party/nspr/prcpucfg_win.h',
246         'third_party/nspr/prtypes.h',
247         'third_party/xdg_user_dirs/xdg_user_dir_lookup.cc',
248         'third_party/xdg_user_dirs/xdg_user_dir_lookup.h',
249         'async_socket_io_handler.h',
250         'async_socket_io_handler_posix.cc',
251         'async_socket_io_handler_win.cc',
252         'auto_reset.h',
253         'event_recorder.h',
254         'event_recorder_stubs.cc',
255         'event_recorder_win.cc',
256         'linux_util.cc',
257         'linux_util.h',
258         'message_loop/message_pump_android.cc',
259         'message_loop/message_pump_android.h',
260         'message_loop/message_pump_glib.cc',
261         'message_loop/message_pump_glib.h',
262         'message_loop/message_pump_gtk.cc',
263         'message_loop/message_pump_gtk.h',
264         'message_loop/message_pump_io_ios.cc',
265         'message_loop/message_pump_io_ios.h',
266         'message_loop/message_pump_observer.h',
267         'message_loop/message_pump_libevent.cc',
268         'message_loop/message_pump_libevent.h',
269         'message_loop/message_pump_mac.h',
270         'message_loop/message_pump_mac.mm',
271         'message_loop/message_pump_x11.cc',
272         'message_loop/message_pump_x11.h',
273         'metrics/field_trial.cc',
274         'metrics/field_trial.h',
275         'posix/file_descriptor_shuffle.cc',
276         'posix/file_descriptor_shuffle.h',
277         'sync_socket.h',
278         'sync_socket_win.cc',
279         'sync_socket_posix.cc',
280       ],
281     },
282     {
283       'target_name': 'base_i18n',
284       'type': '<(component)',
285       'variables': {
286         'enable_wexit_time_destructors': 1,
287         'optimize': 'max',
288         'base_i18n_target': 1,
289       },
290       'dependencies': [
291         'base',
292         'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
293         '../third_party/icu/icu.gyp:icui18n',
294         '../third_party/icu/icu.gyp:icuuc',
295       ],
296       'conditions': [
297         ['toolkit_uses_gtk==1', {
298           'dependencies': [
299             # i18n/rtl.cc uses gtk
300             '../build/linux/system.gyp:gtk',
301           ],
302         }],
303         ['OS == "win"', {
304           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
305           'msvs_disabled_warnings': [
306             4267,
307           ],
308         }],
309       ],
310       'export_dependent_settings': [
311         'base',
312       ],
315     },
316     {
317       'target_name': 'base_message_loop_tests',
318       'type': 'static_library',
319       'dependencies': [
320         'base',
321         '../testing/gtest.gyp:gtest',
322       ],
323       'sources': [
324         'message_loop/message_loop_test.cc',
325         'message_loop/message_loop_test.h',
326       ],
327     },
328     {
329       'target_name': 'base_prefs',
330       'type': '<(component)',
331       'variables': {
332         'enable_wexit_time_destructors': 1,
333         'optimize': 'max',
334       },
335       'dependencies': [
336         'base',
337       ],
338       'export_dependent_settings': [
339         'base',
340       ],
341       'defines': [
342         'BASE_PREFS_IMPLEMENTATION',
343       ],
344       'sources': [
345         'prefs/base_prefs_export.h',
346         'prefs/default_pref_store.cc',
347         'prefs/default_pref_store.h',
348         'prefs/json_pref_store.cc',
349         'prefs/json_pref_store.h',
350         'prefs/overlay_user_pref_store.cc',
351         'prefs/overlay_user_pref_store.h',
352         'prefs/persistent_pref_store.h',
353         'prefs/pref_change_registrar.cc',
354         'prefs/pref_change_registrar.h',
355         'prefs/pref_filter.h',
356         'prefs/pref_member.cc',
357         'prefs/pref_member.h',
358         'prefs/pref_notifier.h',
359         'prefs/pref_notifier_impl.cc',
360         'prefs/pref_notifier_impl.h',
361         'prefs/pref_observer.h',
362         'prefs/pref_registry.cc',
363         'prefs/pref_registry.h',
364         'prefs/pref_registry_simple.cc',
365         'prefs/pref_registry_simple.h',
366         'prefs/pref_service.cc',
367         'prefs/pref_service.h',
368         'prefs/pref_service_factory.cc',
369         'prefs/pref_service_factory.h',
370         'prefs/pref_store.cc',
371         'prefs/pref_store.h',
372         'prefs/pref_value_map.cc',
373         'prefs/pref_value_map.h',
374         'prefs/pref_value_store.cc',
375         'prefs/pref_value_store.h',
376         'prefs/scoped_user_pref_update.cc',
377         'prefs/scoped_user_pref_update.h',
378         'prefs/value_map_pref_store.cc',
379         'prefs/value_map_pref_store.h',
380         'prefs/writeable_pref_store.h',
381       ],
382     },
383     {
384       'target_name': 'base_prefs_test_support',
385       'type': 'static_library',
386       'dependencies': [
387         'base',
388         'base_prefs',
389         '../testing/gmock.gyp:gmock',
390       ],
391       'sources': [
392         'prefs/mock_pref_change_callback.cc',
393         'prefs/pref_store_observer_mock.cc',
394         'prefs/pref_store_observer_mock.h',
395         'prefs/testing_pref_service.cc',
396         'prefs/testing_pref_service.h',
397         'prefs/testing_pref_store.cc',
398         'prefs/testing_pref_store.h',
399       ],
400     },
401     {
402       # This is the subset of files from base that should not be used with a
403       # dynamic library. Note that this library cannot depend on base because
404       # base depends on base_static.
405       'target_name': 'base_static',
406       'type': 'static_library',
407       'variables': {
408         'enable_wexit_time_destructors': 1,
409         'optimize': 'max',
410       },
411       'toolsets': ['host', 'target'],
412       'sources': [
413         'base_switches.cc',
414         'base_switches.h',
415         'win/pe_image.cc',
416         'win/pe_image.h',
417       ],
418       'include_dirs': [
419         '..',
420       ],
421     },
422     # Include this target for a main() function that simply instantiates
423     # and runs a base::TestSuite.
424     {
425       'target_name': 'run_all_unittests',
426       'type': 'static_library',
427       'dependencies': [
428         'test_support_base',
429       ],
430       'sources': [
431         'test/run_all_unittests.cc',
432       ],
433     },
434     {
435       'target_name': 'base_unittests',
436       'type': '<(gtest_target_type)',
437       'sources': [
438         # Tests.
439         'android/activity_status_unittest.cc',
440         'android/jni_android_unittest.cc',
441         'android/jni_array_unittest.cc',
442         'android/jni_string_unittest.cc',
443         'android/path_utils_unittest.cc',
444         'android/scoped_java_ref_unittest.cc',
445         'android/sys_utils_unittest.cc',
446         'async_socket_io_handler_unittest.cc',
447         'at_exit_unittest.cc',
448         'atomicops_unittest.cc',
449         'barrier_closure_unittest.cc',
450         'base64_unittest.cc',
451         'bind_unittest.cc',
452         'bind_unittest.nc',
453         'bits_unittest.cc',
454         'build_time_unittest.cc',
455         'callback_helpers_unittest.cc',
456         'callback_list_unittest.cc',
457         'callback_list_unittest.nc',
458         'callback_unittest.cc',
459         'callback_unittest.nc',
460         'cancelable_callback_unittest.cc',
461         'command_line_unittest.cc',
462         'containers/hash_tables_unittest.cc',
463         'containers/linked_list_unittest.cc',
464         'containers/mru_cache_unittest.cc',
465         'containers/small_map_unittest.cc',
466         'containers/stack_container_unittest.cc',
467         'cpu_unittest.cc',
468         'debug/crash_logging_unittest.cc',
469         'debug/leak_tracker_unittest.cc',
470         'debug/proc_maps_linux_unittest.cc',
471         'debug/stack_trace_unittest.cc',
472         'debug/trace_event_memory_unittest.cc',
473         'debug/trace_event_synthetic_delay_unittest.cc',
474         'debug/trace_event_system_stats_monitor_unittest.cc',
475         'debug/trace_event_unittest.cc',
476         'debug/trace_event_unittest.h',
477         'debug/trace_event_win_unittest.cc',
478         'deferred_sequenced_task_runner_unittest.cc',
479         'environment_unittest.cc',
480         'file_util_unittest.cc',
481         'file_version_info_unittest.cc',
482         'files/dir_reader_posix_unittest.cc',
483         'files/file_path_unittest.cc',
484         'files/file_unittest.cc',
485         'files/file_util_proxy_unittest.cc',
486         'files/important_file_writer_unittest.cc',
487         'files/scoped_temp_dir_unittest.cc',
488         'gmock_unittest.cc',
489         'guid_unittest.cc',
490         'id_map_unittest.cc',
491         'i18n/break_iterator_unittest.cc',
492         'i18n/char_iterator_unittest.cc',
493         'i18n/case_conversion_unittest.cc',
494         'i18n/file_util_icu_unittest.cc',
495         'i18n/icu_string_conversions_unittest.cc',
496         'i18n/number_formatting_unittest.cc',
497         'i18n/rtl_unittest.cc',
498         'i18n/string_search_unittest.cc',
499         'i18n/time_formatting_unittest.cc',
500         'i18n/timezone_unittest.cc',
501         'ini_parser_unittest.cc',
502         'ios/device_util_unittest.mm',
503         'json/json_parser_unittest.cc',
504         'json/json_reader_unittest.cc',
505         'json/json_value_converter_unittest.cc',
506         'json/json_value_serializer_unittest.cc',
507         'json/json_writer_unittest.cc',
508         'json/string_escape_unittest.cc',
509         'lazy_instance_unittest.cc',
510         'logging_unittest.cc',
511         'mac/bind_objc_block_unittest.mm',
512         'mac/foundation_util_unittest.mm',
513         'mac/libdispatch_task_runner_unittest.cc',
514         'mac/mac_util_unittest.mm',
515         'mac/objc_property_releaser_unittest.mm',
516         'mac/scoped_nsobject_unittest.mm',
517         'mac/scoped_sending_event_unittest.mm',
518         'md5_unittest.cc',
519         'memory/aligned_memory_unittest.cc',
520         'memory/discardable_memory_allocator_android_unittest.cc',
521         'memory/discardable_memory_unittest.cc',
522         'memory/discardable_memory_provider_unittest.cc',
523         'memory/linked_ptr_unittest.cc',
524         'memory/ref_counted_memory_unittest.cc',
525         'memory/ref_counted_unittest.cc',
526         'memory/scoped_ptr_unittest.cc',
527         'memory/scoped_ptr_unittest.nc',
528         'memory/scoped_vector_unittest.cc',
529         'memory/shared_memory_unittest.cc',
530         'memory/singleton_unittest.cc',
531         'memory/weak_ptr_unittest.cc',
532         'memory/weak_ptr_unittest.nc',
533         'message_loop/message_loop_proxy_impl_unittest.cc',
534         'message_loop/message_loop_proxy_unittest.cc',
535         'message_loop/message_loop_unittest.cc',
536         'message_loop/message_pump_glib_unittest.cc',
537         'message_loop/message_pump_io_ios_unittest.cc',
538         'message_loop/message_pump_libevent_unittest.cc',
539         'metrics/sample_map_unittest.cc',
540         'metrics/sample_vector_unittest.cc',
541         'metrics/bucket_ranges_unittest.cc',
542         'metrics/field_trial_unittest.cc',
543         'metrics/histogram_base_unittest.cc',
544         'metrics/histogram_delta_serialization_unittest.cc',
545         'metrics/histogram_unittest.cc',
546         'metrics/sparse_histogram_unittest.cc',
547         'metrics/stats_table_unittest.cc',
548         'metrics/statistics_recorder_unittest.cc',
549         'observer_list_unittest.cc',
550         'os_compat_android_unittest.cc',
551         'path_service_unittest.cc',
552         'pickle_unittest.cc',
553         'platform_file_unittest.cc',
554         'posix/file_descriptor_shuffle_unittest.cc',
555         'posix/unix_domain_socket_linux_unittest.cc',
556         'power_monitor/power_monitor_unittest.cc',
557         'prefs/default_pref_store_unittest.cc',
558         'prefs/json_pref_store_unittest.cc',
559         'prefs/mock_pref_change_callback.h',
560         'prefs/overlay_user_pref_store_unittest.cc',
561         'prefs/pref_change_registrar_unittest.cc',
562         'prefs/pref_member_unittest.cc',
563         'prefs/pref_notifier_impl_unittest.cc',
564         'prefs/pref_service_unittest.cc',
565         'prefs/pref_value_map_unittest.cc',
566         'prefs/pref_value_store_unittest.cc',
567         'prefs/scoped_user_pref_update_unittest.cc',
568         'process/memory_unittest.cc',
569         'process/memory_unittest_mac.h',
570         'process/memory_unittest_mac.mm',
571         'process/process_metrics_unittest.cc',
572         'process/process_metrics_unittest_ios.cc',
573         'process/process_util_unittest.cc',
574         'profiler/tracked_time_unittest.cc',
575         'rand_util_unittest.cc',
576         'safe_numerics_unittest.cc',
577         'safe_numerics_unittest.nc',
578         'scoped_clear_errno_unittest.cc',
579         'scoped_native_library_unittest.cc',
580         'scoped_observer.h',
581         'security_unittest.cc',
582         'sequence_checker_unittest.cc',
583         'sha1_unittest.cc',
584         'stl_util_unittest.cc',
585         'strings/nullable_string16_unittest.cc',
586         'strings/safe_sprintf_unittest.cc',
587         'strings/string16_unittest.cc',
588         'strings/stringprintf_unittest.cc',
589         'strings/string_number_conversions_unittest.cc',
590         'strings/string_piece_unittest.cc',
591         'strings/string_split_unittest.cc',
592         'strings/string_tokenizer_unittest.cc',
593         'strings/string_util_unittest.cc',
594         'strings/stringize_macros_unittest.cc',
595         'strings/sys_string_conversions_mac_unittest.mm',
596         'strings/sys_string_conversions_unittest.cc',
597         'strings/utf_offset_string_conversions_unittest.cc',
598         'strings/utf_string_conversions_unittest.cc',
599         'sync_socket_unittest.cc',
600         'synchronization/cancellation_flag_unittest.cc',
601         'synchronization/condition_variable_unittest.cc',
602         'synchronization/lock_unittest.cc',
603         'synchronization/waitable_event_unittest.cc',
604         'synchronization/waitable_event_watcher_unittest.cc',
605         'sys_info_unittest.cc',
606         'system_monitor/system_monitor_unittest.cc',
607         'task_runner_util_unittest.cc',
608         'template_util_unittest.cc',
609         'test/expectations/expectation_unittest.cc',
610         'test/expectations/parser_unittest.cc',
611         'test/test_reg_util_win_unittest.cc',
612         'test/trace_event_analyzer_unittest.cc',
613         'threading/non_thread_safe_unittest.cc',
614         'threading/platform_thread_unittest.cc',
615         'threading/sequenced_worker_pool_unittest.cc',
616         'threading/simple_thread_unittest.cc',
617         'threading/thread_checker_unittest.cc',
618         'threading/thread_collision_warner_unittest.cc',
619         'threading/thread_id_name_manager_unittest.cc',
620         'threading/thread_local_storage_unittest.cc',
621         'threading/thread_local_unittest.cc',
622         'threading/thread_unittest.cc',
623         'threading/watchdog_unittest.cc',
624         'threading/worker_pool_posix_unittest.cc',
625         'threading/worker_pool_unittest.cc',
626         'time/pr_time_unittest.cc',
627         'time/time_unittest.cc',
628         'time/time_win_unittest.cc',
629         'timer/hi_res_timer_manager_unittest.cc',
630         'timer/timer_unittest.cc',
631         'tools_sanity_unittest.cc',
632         'tracked_objects_unittest.cc',
633         'tuple_unittest.cc',
634         'values_unittest.cc',
635         'version_unittest.cc',
636         'vlog_unittest.cc',
637         'win/dllmain.cc',
638         'win/enum_variant_unittest.cc',
639         'win/event_trace_consumer_unittest.cc',
640         'win/event_trace_controller_unittest.cc',
641         'win/event_trace_provider_unittest.cc',
642         'win/i18n_unittest.cc',
643         'win/iunknown_impl_unittest.cc',
644         'win/message_window_unittest.cc',
645         'win/object_watcher_unittest.cc',
646         'win/pe_image_unittest.cc',
647         'win/registry_unittest.cc',
648         'win/scoped_bstr_unittest.cc',
649         'win/scoped_comptr_unittest.cc',
650         'win/scoped_process_information_unittest.cc',
651         'win/scoped_variant_unittest.cc',
652         'win/shortcut_unittest.cc',
653         'win/startup_information_unittest.cc',
654         'win/win_util_unittest.cc',
655         'win/wrapped_window_proc_unittest.cc',
656       ],
657       'dependencies': [
658         'base',
659         'base_i18n',
660         'base_message_loop_tests',
661         'base_prefs',
662         'base_prefs_test_support',
663         'base_static',
664         'run_all_unittests',
665         'test_support_base',
666         'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
667         '../testing/gmock.gyp:gmock',
668         '../testing/gtest.gyp:gtest',
669         '../third_party/icu/icu.gyp:icui18n',
670         '../third_party/icu/icu.gyp:icuuc',
671       ],
672       'includes': ['../build/nocompile.gypi'],
673       'variables': {
674          # TODO(ajwong): Is there a way to autodetect this?
675         'module_dir': 'base'
676       },
677       'conditions': [
678         ['desktop_linux == 1 or chromeos == 1', {
679           'defines': [
680             'USE_SYMBOLIZE',
681           ],
682         }],
683         ['OS == "android"', {
684           'dependencies': [
685             'android/jni_generator/jni_generator.gyp:jni_generator_tests',
686           ],
687           'conditions': [
688             ['gtest_target_type == "shared_library"', {
689               'dependencies': [
690                 '../testing/android/native_test.gyp:native_test_native_code',
691               ],
692             }],
693           ],
694         }],
695         ['OS == "ios" and _toolset != "host"', {
696           'sources/': [
697             # Only test the iOS-meaningful portion of process_utils.
698             ['exclude', '^process/memory_unittest'],
699             ['exclude', '^process/process_util_unittest\\.cc$'],
700             ['include', '^process/process_util_unittest_ios\\.cc$'],
701             # Requires spawning processes.
702             ['exclude', '^metrics/stats_table_unittest\\.cc$'],
703             # iOS does not use message_pump_libevent.
704             ['exclude', '^message_loop/message_pump_libevent_unittest\\.cc$'],
705           ],
706           'actions': [
707             {
708               'action_name': 'copy_test_data',
709               'variables': {
710                 'test_data_files': [
711                   'test/data',
712                 ],
713                 'test_data_prefix': 'base',
714               },
715               'includes': [ '../build/copy_test_data_ios.gypi' ],
716             },
717           ],
718         }],
719         ['desktop_linux == 1 or chromeos == 1', {
720           'sources!': [
721             'file_version_info_unittest.cc',
722           ],
723           'conditions': [
724             [ 'toolkit_uses_gtk==1', {
725               'sources': [
726                 'nix/xdg_util_unittest.cc',
727               ],
728               'dependencies': [
729                 '../build/linux/system.gyp:gtk',
730               ]
731             }],
732           ],
733           'dependencies': [
734             '../build/linux/system.gyp:ssl',
735           ],
736         }],
737         ['use_x11 == 1', {
738           'dependencies': [
739             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
740           ],
741         }],
742         ['use_glib == 1', {
743           'dependencies': [
744             '../build/linux/system.gyp:glib',
745           ],
746         }, {  # use_glib == 0
747           'sources!': [
748             'message_loop/message_pump_glib_unittest.cc',
749           ]
750         }],
751         ['use_ozone == 1', {
752           'sources!': [
753             'message_loop/message_pump_glib_unittest.cc',
754           ]
755         }],
756         ['OS == "linux" and linux_use_tcmalloc==1', {
757             'dependencies': [
758               'allocator/allocator.gyp:allocator',
759             ],
760           },
761         ],
762         ['OS == "win"', {
763           # This is needed to trigger the dll copy step on windows.
764           # TODO(mark): This should not be necessary.
765           'dependencies': [
766             '../third_party/icu/icu.gyp:icudata',
767           ],
768           'sources!': [
769             'file_descriptor_shuffle_unittest.cc',
770             'files/dir_reader_posix_unittest.cc',
771             'threading/worker_pool_posix_unittest.cc',
772             'message_loop/message_pump_libevent_unittest.cc',
773           ],
774           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
775           'msvs_disabled_warnings': [
776             4267,
777           ],
778           # This is needed so base_unittests uses the allocator shim, as
779           # SecurityTest.MemoryAllocationRestriction* tests are dependent
780           # on tcmalloc.
781           # TODO(wfh): crbug.com/246278 Move tcmalloc specific tests into
782           # their own test suite.
783           'conditions': [
784             ['win_use_allocator_shim==1', {
785               'dependencies': [
786                 'allocator/allocator.gyp:allocator',
787               ],
788             }],
789           ],
790         }, {  # OS != "win"
791           'dependencies': [
792             '../third_party/libevent/libevent.gyp:libevent'
793           ],
794           'sources/': [
795             ['exclude', '^win/'],
796           ],
797           'sources!': [
798             'win/win_util_unittest.cc',
799           ],
800         }],
801         ['use_aura==1 and use_x11==1',  {
802           'sources': [
803             'x11/edid_parser_x11_unittest.cc',
804           ],
805         }],
806         ['use_system_nspr==1', {
807           'dependencies': [
808             'third_party/nspr/nspr.gyp:nspr',
809           ],
810         }],
811       ],  # conditions
812       'target_conditions': [
813         ['OS == "ios" and _toolset != "host"', {
814           'sources/': [
815             # Pull in specific Mac files for iOS (which have been filtered out
816             # by file name rules).
817             ['include', '^mac/objc_property_releaser_unittest\\.mm$'],
818             ['include', '^mac/bind_objc_block_unittest\\.mm$'],
819             ['include', '^mac/scoped_nsobject_unittest\\.mm$'],
820             ['include', '^sys_string_conversions_mac_unittest\\.mm$'],
821           ],
822         }],
823         ['OS == "android"', {
824           'sources/': [
825             ['include', '^debug/proc_maps_linux_unittest\\.cc$'],
826           ],
827         }],
828       ],  # target_conditions
829     },
830     {
831       'target_name': 'test_support_base',
832       'type': 'static_library',
833       'dependencies': [
834         'base',
835         'base_static',
836         'base_i18n',
837         '../testing/gmock.gyp:gmock',
838         '../testing/gtest.gyp:gtest',
839         '../third_party/libxml/libxml.gyp:libxml',
840         'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
841       ],
842       'export_dependent_settings': [
843         'base',
844       ],
845       'conditions': [
846         ['toolkit_uses_gtk==1', {
847           'dependencies': [
848             # test_suite initializes GTK.
849             '../build/linux/system.gyp:gtk',
850           ],
851         }],
852         ['os_posix==0', {
853           'sources!': [
854             'test/scoped_locale.cc',
855             'test/scoped_locale.h',
856           ],
857         }],
858         ['os_bsd==1', {
859           'sources!': [
860             'test/test_file_util_linux.cc',
861           ],
862         }],
863         ['OS == "android"', {
864           'dependencies': [
865             'base_unittests_jni_headers',
866             'base_java_unittest_support',
867           ],
868         }],
869       ],
870       'sources': [
871         'test/expectations/expectation.cc',
872         'test/expectations/expectation.h',
873         'test/expectations/parser.cc',
874         'test/expectations/parser.h',
875         'test/gtest_xml_util.cc',
876         'test/gtest_xml_util.h',
877         'test/launcher/test_launcher.cc',
878         'test/launcher/test_launcher.h',
879         'test/launcher/test_result.cc',
880         'test/launcher/test_result.h',
881         'test/launcher/test_results_tracker.cc',
882         'test/launcher/test_results_tracker.h',
883         'test/launcher/unit_test_launcher.cc',
884         'test/launcher/unit_test_launcher.h',
885         'test/launcher/unit_test_launcher_ios.cc',
886         'test/mock_chrome_application_mac.h',
887         'test/mock_chrome_application_mac.mm',
888         'test/mock_devices_changed_observer.cc',
889         'test/mock_devices_changed_observer.h',
890         'test/mock_time_provider.cc',
891         'test/mock_time_provider.h',
892         'test/multiprocess_test.cc',
893         'test/multiprocess_test.h',
894         'test/multiprocess_test_android.cc',
895         'test/null_task_runner.cc',
896         'test/null_task_runner.h',
897         'test/perf_log.cc',
898         'test/perf_log.h',
899         'test/perf_test_suite.cc',
900         'test/perf_test_suite.h',
901         'test/perf_time_logger.cc',
902         'test/perf_time_logger.h',
903         'test/power_monitor_test_base.cc',
904         'test/power_monitor_test_base.h',
905         'test/scoped_locale.cc',
906         'test/scoped_locale.h',
907         'test/scoped_path_override.cc',
908         'test/scoped_path_override.h',
909         'test/sequenced_task_runner_test_template.cc',
910         'test/sequenced_task_runner_test_template.h',
911         'test/sequenced_worker_pool_owner.cc',
912         'test/sequenced_worker_pool_owner.h',
913         'test/simple_test_clock.cc',
914         'test/simple_test_clock.h',
915         'test/simple_test_tick_clock.cc',
916         'test/simple_test_tick_clock.h',
917         'test/task_runner_test_template.cc',
918         'test/task_runner_test_template.h',
919         'test/test_file_util.cc',
920         'test/test_file_util.h',
921         'test/test_file_util_android.cc',
922         'test/test_file_util_linux.cc',
923         'test/test_file_util_mac.cc',
924         'test/test_file_util_posix.cc',
925         'test/test_file_util_win.cc',
926         'test/test_listener_ios.h',
927         'test/test_listener_ios.mm',
928         'test/test_pending_task.cc',
929         'test/test_pending_task.h',
930         'test/test_process_killer_win.cc',
931         'test/test_process_killer_win.h',
932         'test/test_reg_util_win.cc',
933         'test/test_reg_util_win.h',
934         'test/test_shortcut_win.cc',
935         'test/test_shortcut_win.h',
936         'test/test_simple_task_runner.cc',
937         'test/test_simple_task_runner.h',
938         'test/test_suite.cc',
939         'test/test_suite.h',
940         'test/test_support_android.cc',
941         'test/test_support_android.h',
942         'test/test_support_ios.h',
943         'test/test_support_ios.mm',
944         'test/test_switches.cc',
945         'test/test_switches.h',
946         'test/test_timeouts.cc',
947         'test/test_timeouts.h',
948         'test/thread_test_helper.cc',
949         'test/thread_test_helper.h',
950         'test/trace_event_analyzer.cc',
951         'test/trace_event_analyzer.h',
952         'test/values_test_util.cc',
953         'test/values_test_util.h',
954       ],
955       'target_conditions': [
956         ['OS == "ios"', {
957           'sources/': [
958             # Pull in specific Mac files for iOS (which have been filtered out
959             # by file name rules).
960             ['include', '^test/test_file_util_mac\\.cc$'],
961           ],
962           'sources!': [
963             # iOS uses its own unit test launcher.
964             'test/launcher/unit_test_launcher.cc',
965           ],
966         }],
967       ],  # target_conditions
968     },
969     {
970       'target_name': 'test_support_perf',
971       'type': 'static_library',
972       'dependencies': [
973         'base',
974         'test_support_base',
975         '../testing/gtest.gyp:gtest',
976       ],
977       'sources': [
978         'test/run_all_perftests.cc',
979       ],
980       'direct_dependent_settings': {
981         'defines': [
982           'PERF_TEST',
983         ],
984       },
985       'conditions': [
986         ['toolkit_uses_gtk==1', {
987           'dependencies': [
988             # Needed to handle the #include chain:
989             #   base/test/perf_test_suite.h
990             #   base/test/test_suite.h
991             #   gtk/gtk.h
992             '../build/linux/system.gyp:gtk',
993           ],
994         }],
995       ],
996     },
997   ],
998   'conditions': [
999     ['OS!="ios"', {
1000       'targets': [
1001         {
1002           'target_name': 'check_example',
1003           'type': 'executable',
1004           'sources': [
1005             'check_example.cc',
1006           ],
1007           'dependencies': [
1008             'base',
1009           ],
1010         },
1011       ],
1012     }],
1013     ['OS == "win" and target_arch=="ia32"', {
1014       'targets': [
1015         {
1016           'target_name': 'base_nacl_win64',
1017           'type': '<(component)',
1018           'variables': {
1019             'base_target': 1,
1020           },
1021           'dependencies': [
1022             'base_static_win64',
1023             'allocator/allocator.gyp:allocator_extension_thunks_win64',
1024             'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
1025           ],
1026           # TODO(gregoryd): direct_dependent_settings should be shared with the
1027           # 32-bit target, but it doesn't work due to a bug in gyp
1028           'direct_dependent_settings': {
1029             'include_dirs': [
1030               '..',
1031             ],
1032           },
1033           'defines': [
1034             '<@(nacl_win64_defines)',
1035           ],
1036           'sources!': [
1037             # base64.cc depends on modp_b64.
1038             'base64.cc',
1039           ],
1040           'configurations': {
1041             'Common_Base': {
1042               'msvs_target_platform': 'x64',
1043             },
1044           },
1045           'conditions': [
1046             ['component == "shared_library"', {
1047               'sources!': [
1048                 'debug/debug_on_start_win.cc',
1049               ],
1050             }],
1051           ],
1052         },
1053         {
1054           'target_name': 'base_i18n_nacl_win64',
1055           'type': '<(component)',
1056           # TODO(gregoryd): direct_dependent_settings should be shared with the
1057           # 32-bit target, but it doesn't work due to a bug in gyp
1058           'direct_dependent_settings': {
1059             'include_dirs': [
1060               '..',
1061             ],
1062           },
1063           'defines': [
1064             '<@(nacl_win64_defines)',
1065             'BASE_I18N_IMPLEMENTATION',
1066           ],
1067           'include_dirs': [
1068             '..',
1069           ],
1070           'sources': [
1071             'i18n/icu_util_nacl_win64.cc',
1072           ],
1073           'configurations': {
1074             'Common_Base': {
1075               'msvs_target_platform': 'x64',
1076             },
1077           },
1078         },
1079         {
1080           # TODO(rvargas): Remove this when gyp finally supports a clean model.
1081           # See bug 36232.
1082           'target_name': 'base_static_win64',
1083           'type': 'static_library',
1084           'sources': [
1085             'base_switches.cc',
1086             'base_switches.h',
1087             'win/pe_image.cc',
1088             'win/pe_image.h',
1089           ],
1090           'sources!': [
1091             # base64.cc depends on modp_b64.
1092             'base64.cc',
1093           ],
1094           'include_dirs': [
1095             '..',
1096           ],
1097           'configurations': {
1098             'Common_Base': {
1099               'msvs_target_platform': 'x64',
1100             },
1101           },
1102           'defines': [
1103             'NACL_WIN64',
1104           ],
1105           # TODO(rvargas): Bug 78117. Remove this.
1106           'msvs_disabled_warnings': [
1107             4244,
1108           ],
1109         },
1110       ],
1111     }],
1112     ['os_posix==1 and OS!="mac" and OS!="ios"', {
1113       'targets': [
1114         {
1115           'target_name': 'symbolize',
1116           'type': 'static_library',
1117           'toolsets': ['host', 'target'],
1118           'variables': {
1119             'chromium_code': 0,
1120           },
1121           'conditions': [
1122             ['OS == "solaris"', {
1123               'include_dirs': [
1124                 '/usr/gnu/include',
1125                 '/usr/gnu/include/libelf',
1126               ],
1127             },],
1128           ],
1129           'cflags': [
1130             '-Wno-sign-compare',
1131           ],
1132           'cflags!': [
1133             '-Wextra',
1134           ],
1135           'sources': [
1136             'third_party/symbolize/config.h',
1137             'third_party/symbolize/demangle.cc',
1138             'third_party/symbolize/demangle.h',
1139             'third_party/symbolize/glog/logging.h',
1140             'third_party/symbolize/glog/raw_logging.h',
1141             'third_party/symbolize/symbolize.cc',
1142             'third_party/symbolize/symbolize.h',
1143             'third_party/symbolize/utilities.h',
1144           ],
1145           'include_dirs': [
1146             '..',
1147           ],
1148         },
1149         {
1150           'target_name': 'xdg_mime',
1151           'type': 'static_library',
1152           'toolsets': ['host', 'target'],
1153           'variables': {
1154             'chromium_code': 0,
1155           },
1156           'cflags!': [
1157             '-Wextra',
1158           ],
1159           'sources': [
1160             'third_party/xdg_mime/xdgmime.c',
1161             'third_party/xdg_mime/xdgmime.h',
1162             'third_party/xdg_mime/xdgmimealias.c',
1163             'third_party/xdg_mime/xdgmimealias.h',
1164             'third_party/xdg_mime/xdgmimecache.c',
1165             'third_party/xdg_mime/xdgmimecache.h',
1166             'third_party/xdg_mime/xdgmimeglob.c',
1167             'third_party/xdg_mime/xdgmimeglob.h',
1168             'third_party/xdg_mime/xdgmimeicon.c',
1169             'third_party/xdg_mime/xdgmimeicon.h',
1170             'third_party/xdg_mime/xdgmimeint.c',
1171             'third_party/xdg_mime/xdgmimeint.h',
1172             'third_party/xdg_mime/xdgmimemagic.c',
1173             'third_party/xdg_mime/xdgmimemagic.h',
1174             'third_party/xdg_mime/xdgmimeparent.c',
1175             'third_party/xdg_mime/xdgmimeparent.h',
1176           ],
1177         },
1178       ],
1179     }],
1180     ['OS == "android"', {
1181       'targets': [
1182         {
1183           'target_name': 'base_jni_headers',
1184           'type': 'none',
1185           'sources': [
1186             'android/java/src/org/chromium/base/ActivityStatus.java',
1187             'android/java/src/org/chromium/base/BuildInfo.java',
1188             'android/java/src/org/chromium/base/CommandLine.java',
1189             'android/java/src/org/chromium/base/ContentUriUtils.java',
1190             'android/java/src/org/chromium/base/CpuFeatures.java',
1191             'android/java/src/org/chromium/base/ImportantFileWriterAndroid.java',
1192             'android/java/src/org/chromium/base/MemoryPressureListener.java',
1193             'android/java/src/org/chromium/base/JavaHandlerThread.java',
1194             'android/java/src/org/chromium/base/PathService.java',
1195             'android/java/src/org/chromium/base/PathUtils.java',
1196             'android/java/src/org/chromium/base/PowerMonitor.java',
1197             'android/java/src/org/chromium/base/SystemMessageHandler.java',
1198             'android/java/src/org/chromium/base/SysUtils.java',
1199             'android/java/src/org/chromium/base/ThreadUtils.java',
1200           ],
1201           'conditions': [
1202             ['google_tv==1', {
1203              'sources': [
1204                'android/java/src/org/chromium/base/ContextTypes.java',
1205              ],
1206             }],
1207           ],
1208           'variables': {
1209             'jni_gen_package': 'base',
1210             'jni_generator_ptr_type': 'long',
1211           },
1212           'includes': [ '../build/jni_generator.gypi' ],
1213         },
1214         {
1215           'target_name': 'base_unittests_jni_headers',
1216           'type': 'none',
1217           'sources': [
1218             'test/android/java/src/org/chromium/base/ContentUriTestUtils.java',
1219           ],
1220           'variables': {
1221             'jni_gen_package': 'base',
1222           },
1223           'includes': [ '../build/jni_generator.gypi' ],
1224         },
1225         {
1226           'target_name': 'base_java',
1227           'type': 'none',
1228           'variables': {
1229             'java_in_dir': '../base/android/java',
1230           },
1231           'dependencies': [
1232             'base_java_activity_state',
1233             'base_java_memory_pressure_level_list',
1234           ],
1235           'includes': [ '../build/java.gypi' ],
1236           'conditions': [
1237             ['android_webview_build==0', {
1238               'dependencies': [
1239                 '../third_party/jsr-305/jsr-305.gyp:jsr_305_javalib',
1240               ],
1241             }]
1242           ],
1243         },
1244         {
1245           'target_name': 'base_java_unittest_support',
1246           'type': 'none',
1247           'dependencies': [
1248             'base_java',
1249           ],
1250           'variables': {
1251             'java_in_dir': '../base/test/android/java',
1252           },
1253           'includes': [ '../build/java.gypi' ],
1254         },
1255         {
1256           'target_name': 'base_java_activity_state',
1257           'type': 'none',
1258           # This target is used to auto-generate ActivityState.java
1259           # from a template file. The source file contains a list of
1260           # Java constant declarations matching the ones in
1261           # android/activity_state_list.h.
1262           'sources': [
1263             'android/java/src/org/chromium/base/ActivityState.template',
1264           ],
1265           'variables': {
1266             'package_name': 'org/chromium/base',
1267             'template_deps': ['android/activity_state_list.h'],
1268           },
1269           'includes': [ '../build/android/java_cpp_template.gypi' ],
1270         },
1271         {
1272           'target_name': 'base_java_memory_pressure_level_list',
1273           'type': 'none',
1274           'sources': [
1275             'android/java/src/org/chromium/base/MemoryPressureLevelList.template',
1276           ],
1277           'variables': {
1278             'package_name': 'org/chromium/base',
1279             'template_deps': ['memory/memory_pressure_level_list.h'],
1280           },
1281           'includes': [ '../build/android/java_cpp_template.gypi' ],
1282         },
1283         {
1284           'target_name': 'base_java_test_support',
1285           'type': 'none',
1286           'dependencies': [
1287             'base_java',
1288           ],
1289           'variables': {
1290             'java_in_dir': '../base/test/android/javatests',
1291           },
1292           'includes': [ '../build/java.gypi' ],
1293         },
1294         {
1295           'target_name': 'base_javatests',
1296           'type': 'none',
1297           'dependencies': [
1298             'base_java',
1299             'base_java_test_support',
1300           ],
1301           'variables': {
1302             'java_in_dir': '../base/android/javatests',
1303           },
1304           'includes': [ '../build/java.gypi' ],
1305         },
1306       ],
1307     }],
1308     ['OS == "win"', {
1309       'targets': [
1310         {
1311           'target_name': 'debug_message',
1312           'type': 'executable',
1313           'sources': [
1314             'debug_message.cc',
1315           ],
1316           'msvs_settings': {
1317             'VCLinkerTool': {
1318               'SubSystem': '2',         # Set /SUBSYSTEM:WINDOWS
1319             },
1320           },
1321         },
1322       ],
1323     }],
1324     # Special target to wrap a gtest_target_type == shared_library
1325     # base_unittests into an android apk for execution.
1326     # TODO(jrg): lib.target comes from _InstallableTargetInstallPath()
1327     # in the gyp make generator.  What is the correct way to extract
1328     # this path from gyp and into 'raw' for input to antfiles?
1329     # Hard-coding in the gypfile seems a poor choice.
1330     ['OS == "android" and gtest_target_type == "shared_library"', {
1331       'targets': [
1332         {
1333           'target_name': 'base_unittests_apk',
1334           'type': 'none',
1335           'dependencies': [
1336             'base_java',
1337             'base_unittests',
1338           ],
1339           'variables': {
1340             'test_suite_name': 'base_unittests',
1341             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)base_unittests<(SHARED_LIB_SUFFIX)',
1342           },
1343           'includes': [ '../build/apk_test.gypi' ],
1344         },
1345       ],
1346     }],
1347     ['test_isolation_mode != "noop"', {
1348       'targets': [
1349         {
1350           'target_name': 'base_unittests_run',
1351           'type': 'none',
1352           'dependencies': [
1353             'base_unittests',
1354           ],
1355           'includes': [
1356             '../build/isolate.gypi',
1357             'base_unittests.isolate',
1358           ],
1359           'sources': [
1360             'base_unittests.isolate',
1361           ],
1362         },
1363       ],
1364     }],
1365   ],