reloc_packer: Allow aarch64 DSO linked with gold
[chromium-blink-merge.git] / extensions / BUILD.gn
blobf3830ce214276f4119766257961868581aae341f
1 # Copyright 2014 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.
5 import("//testing/test.gni")
6 import("//tools/grit/grit_rule.gni")
7 import("//tools/grit/repack.gni")
9 assert(enable_extensions)
11 # GYP version: extensions/extensions_resources.gyp:extensions_resources
12 group("extensions_resources") {
13   deps = [
14     ":extensions_browser_resources",
15     ":extensions_renderer_resources",
16     ":extensions_resources_grd",
17   ]
20 # GYP version: extensions/extensions_resources.gyp:extensions_resources
21 #              (extensions_resources action)
22 grit("extensions_resources_grd") {
23   source = "extensions_resources.grd"
24   outputs = [
25     "grit/extensions_resources.h",
26     "extensions_resources.pak",
27   ]
30 # GYP version: extensions/extensions_resources.gyp:extensions_resources
31 #              (extensions_browser_resources action)
32 grit("extensions_browser_resources") {
33   source = "browser/resources/extensions_browser_resources.grd"
34   outputs = [
35     "grit/extensions_browser_resources.h",
36     "grit/extensions_browser_resources_map.cc",
37     "grit/extensions_browser_resources_map.h",
38     "extensions_browser_resources_100_percent.pak",
39     "extensions_browser_resources_200_percent.pak",
40   ]
41   grit_flags = [
42     "-E",
43     "mojom_root=" + rebase_path(root_gen_dir),
44   ]
47 # GYP version: extensions/extensions_resources.gyp:extensions_resources
48 #              (extensions_renderer_resources action)
49 grit("extensions_renderer_resources") {
50   source = "renderer/resources/extensions_renderer_resources.grd"
51   outputs = [
52     "grit/extensions_renderer_resources.h",
53     "extensions_renderer_resources.pak",
54   ]
55   grit_flags = [
56     "-E",
57     "mojom_root=" + rebase_path(root_gen_dir),
58   ]
60   deps = [
61     "//device/serial:serial_mojo",
62     "//extensions/common:mojo",
63     "//extensions/common/api:mojom",
64   ]
67 source_set("test_support") {
68   testonly = true
69   sources = [
70     "browser/api/cast_channel/test_util.cc",
71     "browser/api/cast_channel/test_util.h",
72     "browser/api/dns/mock_host_resolver_creator.cc",
73     "browser/api/dns/mock_host_resolver_creator.h",
74     "browser/api/storage/settings_test_util.cc",
75     "browser/api/storage/settings_test_util.h",
76     "browser/api_test_utils.cc",
77     "browser/api_test_utils.h",
78     "browser/api_unittest.cc",
79     "browser/api_unittest.h",
80     "browser/app_window/test_app_window_contents.cc",
81     "browser/app_window/test_app_window_contents.h",
82     "browser/extension_error_test_util.cc",
83     "browser/extension_error_test_util.h",
84     "browser/extensions_test.cc",
85     "browser/extensions_test.h",
86     "browser/guest_view/test_guest_view_manager.cc",
87     "browser/guest_view/test_guest_view_manager.h",
88     "browser/mock_extension_system.cc",
89     "browser/mock_extension_system.h",
90     "browser/test_extension_registry_observer.cc",
91     "browser/test_extension_registry_observer.h",
92     "browser/test_extensions_browser_client.cc",
93     "browser/test_extensions_browser_client.h",
94     "browser/test_management_policy.cc",
95     "browser/test_management_policy.h",
96     "browser/test_runtime_api_delegate.cc",
97     "browser/test_runtime_api_delegate.h",
98     "common/extension_builder.cc",
99     "common/extension_builder.h",
100     "common/manifest_test.cc",
101     "common/manifest_test.h",
102     "common/test_util.cc",
103     "common/test_util.h",
104     "common/value_builder.cc",
105     "common/value_builder.h",
106     "renderer/test_extensions_renderer_client.cc",
107     "renderer/test_extensions_renderer_client.h",
108     "test/extension_test_message_listener.cc",
109     "test/extension_test_message_listener.h",
110     "test/result_catcher.cc",
111     "test/result_catcher.h",
112     "test/test_content_utility_client.cc",
113     "test/test_content_utility_client.h",
114     "test/test_extensions_client.cc",
115     "test/test_extensions_client.h",
116     "test/test_permission_message_provider.cc",
117     "test/test_permission_message_provider.h",
118     "test/test_service_registration_manager.cc",
119     "test/test_service_registration_manager.h",
120   ]
122   deps = [
123     ":extensions_resources",
124     "//base",
125     "//content/public/browser",
126     "//content/public/common",
127     "//content/test:test_support",
128     "//extensions/browser",
129     "//extensions/common",
130     "//extensions/common/api",
131     "//extensions/common/api:api_registration",
132     "//net:test_support",
133     "//testing/gmock",
134     "//testing/gtest",
135   ]
137   public_deps = [
138     "//extensions/common/api/cast_channel:cast_channel_proto",
139   ]
141   if (is_win) {
142     cflags = [ "/wd4267" ]  # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
143   }
146 # GYP version: //extensions/extensions.gyp:extensions_shell_and_test_pak
147 repack("shell_and_test_pak") {
148   sources = [
149     "$root_gen_dir/blink/public/resources/blink_resources.pak",
150     "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
151     "$root_gen_dir/content/content_resources.pak",
152     "$root_gen_dir/content/shell/shell_resources.pak",
153     "$root_gen_dir/extensions/extensions_browser_resources_100_percent.pak",
154     "$root_gen_dir/extensions/extensions_renderer_resources.pak",
155     "$root_gen_dir/extensions/extensions_resources.pak",
156     "$root_gen_dir/extensions/shell/app_shell_resources.pak",
157     "$root_gen_dir/extensions/strings/extensions_strings_en-US.pak",
158     "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
159     "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
160     "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
161     "$root_gen_dir/blink/devtools_resources.pak",
162   ]
164   output = "$root_out_dir/extensions_shell_and_test.pak"
166   deps = [
167     ":extensions_resources",
168     "//content:resources",
169     "//content/browser/devtools:devtools_resources",
170     "//content/shell:resources",
171     "//extensions/shell:resources",
172     "//extensions/strings",
173     "//third_party/WebKit/public:resources",
174     "//ui/resources",
175     "//ui/strings",
176   ]
179 test("extensions_unittests") {
180   sources = [
181     # TODO(rockot|jamescook): This list is out of date. Move the files into
182     # gypi source lists.
183     "browser/api/api_resource_manager_unittest.cc",
184     "browser/api/cast_channel/cast_auth_ica_unittest.cc",
185     "browser/api/cast_channel/cast_auth_util_unittest.cc",
186     "browser/api/cast_channel/cast_channel_api_unittest.cc",
187     "browser/api/cast_channel/cast_framer_unittest.cc",
188     "browser/api/cast_channel/cast_socket_unittest.cc",
189     "browser/api/cast_channel/cast_transport_unittest.cc",
190     "browser/api/cast_channel/keep_alive_delegate_unittest.cc",
191     "browser/api/cast_channel/logger_unittest.cc",
192     "browser/api/declarative/declarative_rule_unittest.cc",
193     "browser/api/declarative/deduping_factory_unittest.cc",
194     "browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc",
195     "browser/api/declarative_webrequest/webrequest_condition_unittest.cc",
196     "browser/api/idle/idle_api_unittest.cc",
197     "browser/api/mime_handler_private/mime_handler_private_unittest.cc",
198     "browser/api/sockets_tcp/sockets_tcp_api_unittest.cc",
199     "browser/api/sockets_udp/sockets_udp_api_unittest.cc",
200     "browser/api/storage/settings_quota_unittest.cc",
201     "browser/api/storage/storage_api_unittest.cc",
202     "browser/api/storage/storage_frontend_unittest.cc",
203     "browser/api/web_request/form_data_parser_unittest.cc",
204     "browser/api/web_request/upload_data_presenter_unittest.cc",
205     "browser/api/web_request/web_request_time_tracker_unittest.cc",
206     "browser/computed_hashes_unittest.cc",
207     "browser/content_hash_tree_unittest.cc",
208     "browser/event_listener_map_unittest.cc",
209     "browser/event_router_unittest.cc",
210     "browser/extension_pref_value_map_unittest.cc",
211     "browser/extension_registry_unittest.cc",
212     "browser/file_highlighter_unittest.cc",
213     "browser/file_reader_unittest.cc",
214     "browser/guest_view/guest_view_manager_unittest.cc",
215     "browser/image_loader_unittest.cc",
216     "browser/info_map_unittest.cc",
217     "browser/lazy_background_task_queue_unittest.cc",
218     "browser/management_policy_unittest.cc",
219     "browser/mojo/keep_alive_impl_unittest.cc",
220     "browser/process_manager_unittest.cc",
221     "browser/process_map_unittest.cc",
222     "browser/quota_service_unittest.cc",
223     "browser/runtime_data_unittest.cc",
224     "browser/sandboxed_unpacker_unittest.cc",
225     "browser/value_store/leveldb_value_store_unittest.cc",
226     "browser/value_store/testing_value_store_unittest.cc",
227     "browser/value_store/value_store_change_unittest.cc",
228     "browser/value_store/value_store_frontend_unittest.cc",
229     "browser/value_store/value_store_unittest.cc",
230     "browser/value_store/value_store_unittest.h",
231     "browser/verified_contents_unittest.cc",
232     "browser/warning_service_unittest.cc",
233     "common/api/sockets/sockets_manifest_permission_unittest.cc",
234     "common/csp_validator_unittest.cc",
235     "common/event_filter_unittest.cc",
236     "common/extension_l10n_util_unittest.cc",
237     "common/extension_resource_unittest.cc",
238     "common/extension_set_unittest.cc",
239     "common/file_util_unittest.cc",
240     "common/image_util_unittest.cc",
241     "common/manifest_handlers/content_capabilities_manifest_unittest.cc",
242     "common/manifest_handlers/oauth2_manifest_unittest.cc",
243     "common/manifest_handlers/shared_module_manifest_unittest.cc",
244     "common/manifest_handler_unittest.cc",
245     "common/message_bundle_unittest.cc",
246     "common/one_shot_event_unittest.cc",
247     "common/permissions/manifest_permission_set_unittest.cc",
248     "common/stack_frame_unittest.cc",
249     "common/url_pattern_set_unittest.cc",
250     "common/url_pattern_unittest.cc",
251     "common/user_script_unittest.cc",
252     "renderer/activity_log_converter_strategy_unittest.cc",
253     "renderer/api/mojo_private/mojo_private_unittest.cc",
254     "renderer/api/serial/data_receiver_unittest.cc",
255     "renderer/api/serial/data_sender_unittest.cc",
256     "renderer/api/serial/serial_api_unittest.cc",
257     "renderer/api_test_base.cc",
258     "renderer/api_test_base.h",
259     "renderer/api_test_base_unittest.cc",
260     "renderer/event_unittest.cc",
261     "renderer/json_schema_unittest.cc",
262     "renderer/messaging_utils_unittest.cc",
263     "renderer/module_system_test.cc",
264     "renderer/module_system_test.h",
265     "renderer/module_system_unittest.cc",
266     "renderer/mojo/keep_alive_client_unittest.cc",
267     "renderer/safe_builtins_unittest.cc",
268     "renderer/script_context_set_unittest.cc",
269     "renderer/script_context_unittest.cc",
270     "renderer/mojo/stash_client_unittest.cc",
271     "renderer/utils_unittest.cc",
272     "test/extensions_unittests_main.cc",
273     "utility/unpacker_unittest.cc",
275     # TODO(rockot): DisplayInfoProvider::Create() is only implemented in Chrome
276     # and app_shell. This is wrong.
277     "shell/browser/shell_display_info_provider.cc",
279     # TODO(rockot): See above, but the header is in //components.
280     "shell/browser/shell_web_contents_modal_dialog_manager.cc",
281   ]
283   deps = [
284     ":extensions_resources",
285     ":shell_and_test_pak",
286     ":test_support",
287     "//base",
288     "//base:prefs_test_support",
289     "//base/test:test_support",
290     "//components/keyed_service/content",
291     "//components/user_prefs",
292     "//content/test:test_support",
293     "//device/serial",
294     "//device/serial:test_support",
295     "//extensions/common",
296     "//extensions/common/api/cast_channel:cast_channel_proto",
297     "//extensions/renderer",
298     "//extensions/strings",
299     "//extensions/utility",
300     "//mojo/environment:chromium",
301     "//testing/gmock",
302     "//testing/gtest",
303     "//third_party/leveldatabase",
304     "//third_party/mojo/src/mojo/edk/js",
305     "//third_party/mojo/src/mojo/edk/system",
306     "//third_party/mojo/src/mojo/public/cpp/bindings",
307     "//third_party/mojo/src/mojo/public/interfaces/application",
308   ]
310   if (is_win) {
311     deps += [ "//base/allocator" ]
312   }
314   if (is_chromeos) {
315     sources += [
316       # TODO(rockot): There are two implementations of VpnServiceFactory, a
317       # stub in app_shell and a real one in Chrome. This is wrong.
318       "shell/browser/api/vpn_provider/vpn_service_factory.cc",
319     ]
320   }
323 test("extensions_browsertests") {
324   sources = [
325     "browser/api/audio/audio_apitest.cc",
326     "browser/api/bluetooth_socket/bluetooth_socket_apitest.cc",
327     "browser/api/dns/dns_apitest.cc",
328     "browser/api/hid/hid_apitest.cc",
329     "browser/api/socket/socket_apitest.cc",
330     "browser/api/sockets_tcp/sockets_tcp_apitest.cc",
331     "browser/api/sockets_udp/sockets_udp_apitest.cc",
332     "browser/api/system_cpu/system_cpu_apitest.cc",
333     "browser/api/system_display/system_display_apitest.cc",
334     "browser/api/system_memory/system_memory_apitest.cc",
335     "browser/api/system_network/system_network_apitest.cc",
336     "browser/api/system_storage/storage_api_test_util.cc",
337     "browser/api/system_storage/storage_api_test_util.h",
338     "browser/api/system_storage/system_storage_apitest.cc",
339     "browser/api/system_storage/system_storage_eject_apitest.cc",
340     "browser/api/usb/usb_apitest.cc",
341     "browser/guest_view/app_view/app_view_apitest.cc",
342     "browser/guest_view/web_view/web_view_apitest.h",
343     "browser/guest_view/web_view/web_view_apitest.cc",
344     "browser/guest_view/web_view/web_view_media_access_apitest.cc",
345     "browser/updater/update_service_browsertest.cc",
346     "shell/browser/geolocation/geolocation_apitest.cc",
347     "shell/browser/shell_browsertest.cc",
348     "shell/test/shell_apitest.cc",
349     "shell/test/shell_apitest.h",
350     "shell/test/shell_test.cc",
351     "shell/test/shell_test.h",
352     "shell/test/shell_test_launcher_delegate.cc",
353     "shell/test/shell_test_launcher_delegate.h",
354     "shell/test/shell_tests_main.cc",
355   ]
357   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
359   deps = [
360     ":test_support",
361     "shell:app_shell_lib",
363     # TODO(yoz): find the right deps
364     "//base",
365     "//base:prefs_test_support",
366     "//base/test:test_support",
367     "//components/storage_monitor:test_support",
368     "//content/test:test_support",
369     "//device/bluetooth:mocks",
370     "//mojo/environment:chromium",
371     "//testing/gmock",
372     "//testing/gtest",
373     "//third_party/mojo/src/mojo/edk/js",
374     "//third_party/mojo/src/mojo/edk/system",
375     "//third_party/mojo/src/mojo/public/cpp/bindings",
376   ]
378   if (is_win) {
379     deps += [ "//base/allocator" ]
380   }
382   if (is_mac) {
383     deps += [ "shell:app_shell" ]  # Needed for App Shell.app's Helper.
384   }