Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / web / web_tests.gyp
blob87d19c38f8b23551d8a3fac022cd4566b64a13b1
2 # Copyright (C) 2011 Google Inc. All rights reserved.
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are
6 # met:
8 #         * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 #         * Redistributions in binary form must reproduce the above
11 # copyright notice, this list of conditions and the following disclaimer
12 # in the documentation and/or other materials provided with the
13 # distribution.
14 #         * Neither the name of Google Inc. nor the names of its
15 # contributors may be used to endorse or promote products derived from
16 # this software without specific prior written permission.
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32     'includes': [
33         '../bindings/bindings.gypi',
34         '../build/features.gypi',
35         '../build/scripts/scripts.gypi',
36         '../core/core.gypi',
37         '../modules/modules.gypi',
38         '../platform/blink_platform.gypi',
39         '../web/web.gypi',
40         '../wtf/wtf.gypi',
41     ],
42     'targets': [
43         {
44             # GN version: //third_party/WebKit/Source/web:webkit_unit_tests
45             'target_name': 'webkit_unit_tests',
46             'type': 'executable',
47             'variables': { 'enable_wexit_time_destructors': 1, },
48             'dependencies': [
49                 '../../public/blink.gyp:blink',
50                 '../config.gyp:unittest_config',
51                 '../platform/blink_platform_tests.gyp:blink_platform_test_support',
52                 '../wtf/wtf_tests.gyp:wtf_unittest_helpers',
53                 'web.gyp:blink_web_test_support',
54                 '<(DEPTH)/base/base.gyp:base',
55                 '<(DEPTH)/base/base.gyp:base_i18n',
56                 '<(DEPTH)/base/base.gyp:test_support_base',
57                 '<(DEPTH)/testing/gmock.gyp:gmock',
58                 '<(DEPTH)/testing/gtest.gyp:gtest',
59                 '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
60                 '<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
61                 '<(DEPTH)/url/url.gyp:url_lib',
62                 '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
63                 '<(DEPTH)/content/content_shell_and_tests.gyp:test_support_content',
64             ],
65             'sources': [
66                 '../web/tests/RunAllTests.cpp',
67             ],
68             'include_dirs': [
69                 '../../public/web',
70                 '../web',
71                 'src',
72             ],
73             'conditions': [
74                 ['component!="shared_library"', {
75                     'dependencies': [
76                         '../core/core.gyp:webcore',
77                     ],
78                     'defines': [
79                         'BLINK_IMPLEMENTATION=1',
80                         'INSIDE_BLINK',
81                     ],
82                     'sources': [
83                         '<@(bindings_unittest_files)',
84                         '<@(platform_unittest_support_files)',
85                         '<@(core_unittest_files)',
86                         '<@(modules_unittest_files)',
87                         '<@(platform_web_unittest_files)',
88                         '<@(web_unittest_files)',
89                     ],
90                 }],
91                 ['OS=="win" and component!="shared_library"', {
92                     'configurations': {
93                         'Debug_Base': {
94                             'msvs_settings': {
95                                 'VCLinkerTool': {
96                                     'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
97                                 },
98                             },
99                         },
100                     },
101                     'conditions': [
102                         ['win_use_allocator_shim==1', {
103                             'dependencies': [
104                                 '<(DEPTH)/base/allocator/allocator.gyp:allocator',
105                             ],
106                         }],
107                     ],
108                 }],
109                 ['OS=="android"', {
110                     'type': 'shared_library',
111                     'dependencies': [
112                         '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
113                         '<(DEPTH)/tools/android/forwarder2/forwarder.gyp:forwarder2',
114                     ],
115                 }],
116                 ['OS=="mac"', {
117                     'include_dirs': [
118                         '../../public/web/mac',
119                     ],
120                 }],
121                 [ 'os_posix==1 and OS!="mac" and OS!="android" and OS!="ios" and use_allocator!="none"', {
122                     'dependencies': [
123                         '<(DEPTH)/base/allocator/allocator.gyp:allocator',
124                     ],
125                 }],
126             ],
127         }
128     ], # targets
129     'conditions': [
130         ['gcc_version>=46', {
131             'target_defaults': {
132                 # Disable warnings about c++0x compatibility, as some names (such
133                 # as nullptr) conflict with upcoming c++0x types.
134                 'cflags_cc': ['-Wno-c++0x-compat'],
135             },
136         }],
137         ['OS=="android" and gtest_target_type == "shared_library"', {
138             # Wrap libwebkit_unit_tests.so into an android apk for execution.
139             'targets': [{
140                 'target_name': 'webkit_unit_tests_apk',
141                 'type': 'none',
142                 'dependencies': [
143                     '<(DEPTH)/base/base.gyp:base_java',
144                     '<(DEPTH)/content/content_shell_and_tests.gyp:content_shell_pak',
145                     '<(DEPTH)/net/net.gyp:net_java',
146                     'webkit_unit_tests',
147                 ],
148                 'conditions': [
149                   ['v8_use_external_startup_data==1', {
150                     'dependencies': [
151                       '<(DEPTH)/v8/tools/gyp/v8.gyp:v8_external_snapshot',
152                       '<(DEPTH)/content/content.gyp:content_v8_external_data',
153                     ],
154                   }],
155                 ],
156                 'variables': {
157                     'test_suite_name': 'webkit_unit_tests',
158                     'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)webkit_unit_tests<(SHARED_LIB_SUFFIX)',
159                     'additional_input_paths': ['<(PRODUCT_DIR)/content_shell/assets/content_shell.pak'],
160                     'asset_location': '<(PRODUCT_DIR)/content_shell/assets',
161                     'conditions': [
162                       ['v8_use_external_startup_data==1', {
163                         'additional_input_paths': [
164                           '<(PRODUCT_DIR)/content_shell/assets/natives_blob.bin',
165                           '<(PRODUCT_DIR)/content_shell/assets/snapshot_blob.bin',
166                         ],
167                         'inputs': [
168                           '<(PRODUCT_DIR)/natives_blob.bin',
169                           '<(PRODUCT_DIR)/snapshot_blob.bin',
170                         ],
171                       }],
172                     ],
173                 },
174                 'includes': [ '../../../../build/apk_test.gypi' ],
175             }],
176         }],
177         ['test_isolation_mode != "noop"', {
178             'targets': [
179                 {
180                     'target_name': 'webkit_unit_tests_run',
181                     'type': 'none',
182                     'dependencies': [
183                         'webkit_unit_tests',
184                     ],
185                     'includes': [
186                         '../../../../build/isolate.gypi',
187                     ],
188                     'sources': [
189                         'webkit_unit_tests.isolate',
190                     ],
191                 },
192             ],
193         }],
194     ],