[GCM] Support registration before unregistration finishes
[chromium-blink-merge.git] / extensions / BUILD.gn
blob1c9602ea57963f06beee3595b61397e911ff527f
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("//tools/grit/grit_rule.gni")
6 import("//tools/grit/repack.gni")
8 # GYP version: extensions/extensions_resources.gyp:extensions_resources
9 group("extensions_resources") {
10   deps = [
11     ":extensions_browser_resources",
12     ":extensions_renderer_resources",
13     ":extensions_resources_grd",
14   ]
17 # GYP version: extensions/extensions_resources.gyp:extensions_resources
18 #              (extensions_resources action)
19 grit("extensions_resources_grd") {
20   source = "extensions_resources.grd"
21   outputs = [
22     "grit/extensions_resources.h",
23     "extensions_resources.pak",
24   ]
27 # GYP version: extensions/extensions_resources.gyp:extensions_resources
28 #              (extensions_browser_resources action)
29 grit("extensions_browser_resources") {
30   source = "browser/resources/extensions_browser_resources.grd"
31   outputs = [
32     "grit/extensions_browser_resources.h",
33     "grit/extensions_browser_resources_map.cc",
34     "grit/extensions_browser_resources_map.h",
35     "extensions_browser_resources_100_percent.pak",
36     "extensions_browser_resources_200_percent.pak",
37   ]
38   grit_flags = [ "-E", "mojom_root=" + rebase_path(root_gen_dir) ]
41 # GYP version: extensions/extensions_resources.gyp:extensions_resources
42 #              (extensions_renderer_resources action)
43 grit("extensions_renderer_resources") {
44   source = "renderer/resources/extensions_renderer_resources.grd"
45   outputs = [
46     "grit/extensions_renderer_resources.h",
47     "extensions_renderer_resources.pak",
48   ]
49   grit_flags = [ "-E", "mojom_root=" + rebase_path(root_gen_dir) ]
51   # TODO(GYP,cjhopman): GYP has this dependency guarded by enable_extensions==1,
52   # but I don't know how that possibly works.
53   deps = [
54     "//device/serial:serial_mojo",
55   ]
58 if (enable_extensions) {
60 source_set("test_support") {
61   testonly = true
62   sources = [
63     "browser/api/dns/mock_host_resolver_creator.cc",
64     "browser/api/dns/mock_host_resolver_creator.h",
65     "browser/api/storage/settings_test_util.cc",
66     "browser/api/storage/settings_test_util.h",
67     "browser/api_test_utils.cc",
68     "browser/api_test_utils.h",
69     "browser/api_unittest.cc",
70     "browser/api_unittest.h",
71     "browser/extensions_test.cc",
72     "browser/extensions_test.h",
73     "browser/mock_extension_system.cc",
74     "browser/mock_extension_system.h",
75     "browser/test_extensions_browser_client.cc",
76     "browser/test_extensions_browser_client.h",
77     "browser/test_management_policy.cc",
78     "browser/test_management_policy.h",
79     "browser/test_runtime_api_delegate.cc",
80     "browser/test_runtime_api_delegate.h",
81     "common/extension_builder.cc",
82     "common/extension_builder.h",
83     "common/manifest_test.cc",
84     "common/manifest_test.h",
85     "common/test_util.cc",
86     "common/test_util.h",
87     "common/value_builder.cc",
88     "common/value_builder.h",
89     "renderer/test_extensions_renderer_client.cc",
90     "renderer/test_extensions_renderer_client.h",
91     "test/extension_test_message_listener.cc",
92     "test/extension_test_message_listener.h",
93     "test/test_extensions_client.cc",
94     "test/test_extensions_client.h",
95     "test/test_permission_message_provider.cc",
96     "test/test_permission_message_provider.h",
97     "test/test_service_registration_manager.cc",
98     "test/test_service_registration_manager.h",
99    ]
101   deps = [
102     ":extensions_resources",
103     "//base",
104     "//content/public/browser",
105     "//content/public/common",
106     "//content/test:test_support",
107     "//extensions/browser",
108     "//extensions/common",
109     "//extensions/common/api",
110     "//extensions/common/api:api_registration",
111     "//net:test_support",
112     "//testing/gmock",
113     "//testing/gtest",
114   ]
116   if (is_win) {
117     cflags = [
118       "/wd4267", # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
119     ]
120   }
124 # GYP version: //extensions/extensions.gyp:extensions_shell_and_test_pak
125 repack("shell_and_test_pak") {
126   sources = [
127     "$root_gen_dir/chrome/common_resources.pak",
128     "$root_gen_dir/chrome/extensions_api_resources.pak",
129     # TODO(jamescook): Extract the extension/app related resources
130     # from generated_resources_en-US.pak. http://crbug.com/397250
131     "$root_gen_dir/chrome/generated_resources_en-US.pak",
132     "$root_gen_dir/chrome/renderer_resources_100_percent.pak",
133     "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
134     "$root_gen_dir/content/content_resources.pak",
135     "$root_gen_dir/content/shell/shell_resources.pak",
136     "$root_gen_dir/extensions/extensions_renderer_resources.pak",
137     "$root_gen_dir/extensions/extensions_resources.pak",
138     "$root_gen_dir/extensions/shell/app_shell_resources.pak",
139     "$root_gen_dir/extensions/strings/extensions_strings_en-US.pak",
140     "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
141     "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
142     "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
143     "$root_gen_dir/webkit/devtools_resources.pak",
144   ]
146   output = "$root_out_dir/extensions_shell_and_test.pak"
148   deps = [
149     ":extensions_resources",
150     # Need extension related resources in common_resources.pak and
151     # renderer_resources_100_percent.pak
152     "//chrome:resources",
153     # Need dev-tools related resources in shell_resources.pak and
154     # devtools_resources.pak.
155     "//content/browser/devtools:resources",
156     "//content/shell:resources",
157     "//content:resources",
158     "//extensions/shell:resources",
159     "//extensions/strings",
160     "//ui/resources",
161     "//ui/strings",
162   ]
165 # TODO(GYP): Enable this link errors are fixed.
166 # This gives a link error in web_modal that is very mysterious. The GYP build
167 # doesn't seem to pull in web_content_modal_dialog_manager.o since the build
168 # does not have a reference to CreateNativeWebModalManager but it still links.
169 # The GN build fails with this symbol being undefined.
170 if (false) {
171 test("extensions_unittests") {
172   sources = [
173     "browser/admin_policy_unittest.cc",
174     "browser/api/api_resource_manager_unittest.cc",
175     "browser/api/declarative/declarative_rule_unittest.cc",
176     "browser/api/declarative/deduping_factory_unittest.cc",
177     "browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc",
178     "browser/api/declarative_webrequest/webrequest_condition_unittest.cc",
179     "browser/api/sockets_tcp/sockets_tcp_api_unittest.cc",
180     "browser/api/storage/settings_quota_unittest.cc",
181     "browser/api/storage/storage_api_unittest.cc",
182     "browser/api/storage/storage_frontend_unittest.cc",
183     "browser/api/web_request/form_data_parser_unittest.cc",
184     "browser/api/web_request/upload_data_presenter_unittest.cc",
185     "browser/api/web_request/web_request_time_tracker_unittest.cc",
186     "browser/computed_hashes_unittest.cc",
187     "browser/content_hash_tree_unittest.cc",
188     "browser/event_listener_map_unittest.cc",
189     "browser/event_router_unittest.cc",
190     "browser/extension_pref_value_map_unittest.cc",
191     "browser/extension_registry_unittest.cc",
192     "browser/file_highlighter_unittest.cc",
193     "browser/file_reader_unittest.cc",
194     "browser/guest_view/guest_view_manager_unittest.cc",
195     "browser/image_loader_unittest.cc",
196     "browser/image_util_unittest.cc",
197     "browser/info_map_unittest.cc",
198     "browser/lazy_background_task_queue_unittest.cc",
199     "browser/management_policy_unittest.cc",
200     "browser/mojo/keep_alive_impl_unittest.cc",
201     "browser/process_manager_unittest.cc",
202     "browser/process_map_unittest.cc",
203     "browser/quota_service_unittest.cc",
204     "browser/runtime_data_unittest.cc",
205     "browser/value_store/leveldb_value_store_unittest.cc",
206     "browser/value_store/testing_value_store_unittest.cc",
207     "browser/value_store/value_store_change_unittest.cc",
208     "browser/value_store/value_store_frontend_unittest.cc",
209     "browser/value_store/value_store_unittest.cc",
210     "browser/value_store/value_store_unittest.h",
211     "browser/verified_contents_unittest.cc",
212     "browser/warning_service_unittest.cc",
213     "common/api/sockets/sockets_manifest_permission_unittest.cc",
214     "common/csp_validator_unittest.cc",
215     "common/event_filter_unittest.cc",
216     "common/extension_l10n_util_unittest.cc",
217     "common/extension_resource_unittest.cc",
218     "common/extension_set_unittest.cc",
219     "common/file_util_unittest.cc",
220     "common/manifest_handler_unittest.cc",
221     "common/manifest_handlers/oauth2_manifest_unittest.cc",
222     "common/manifest_handlers/shared_module_manifest_unittest.cc",
223     "common/message_bundle_unittest.cc",
224     "common/one_shot_event_unittest.cc",
225     "common/permissions/manifest_permission_set_unittest.cc",
226     "common/stack_frame_unittest.cc",
227     "common/url_pattern_set_unittest.cc",
228     "common/url_pattern_unittest.cc",
229     "common/user_script_unittest.cc",
230     "renderer/activity_log_converter_strategy_unittest.cc",
231     "renderer/api/serial/data_receiver_unittest.cc",
232     "renderer/api/serial/data_sender_unittest.cc",
233     "renderer/api/serial/serial_api_unittest.cc",
234     "renderer/api_test_base.cc",
235     "renderer/api_test_base.h",
236     "renderer/api_test_base_unittest.cc",
237     "renderer/event_unittest.cc",
238     "renderer/json_schema_unittest.cc",
239     "renderer/messaging_utils_unittest.cc",
240     "renderer/module_system_test.cc",
241     "renderer/module_system_test.h",
242     "renderer/module_system_unittest.cc",
243     "renderer/mojo/keep_alive_client_unittest.cc",
244     "renderer/safe_builtins_unittest.cc",
245     "renderer/script_context_set_unittest.cc",
246     "renderer/utils_unittest.cc",
247     "test/extensions_unittests_main.cc",
248   ]
250   deps = [
251     ":extensions_resources",
252     ":shell_and_test_pak",
253     ":test_support",
254     "//base",
255     "//base:prefs_test_support",
256     "//base/test:test_support",
257     "//components/keyed_service/content",
258     "//content/test:test_support",
259     "//device/serial",
260     "//device/serial:test_util",
261     "//extensions/common",
262     "//extensions/renderer",
263     "//extensions/strings",
264     "//mojo/bindings/js",
265     "//mojo/edk/system",
266     "//mojo/environment:chromium",
267     "//mojo/public/cpp/bindings",
268     "//testing/gmock",
269     "//testing/gtest",
270     "//third_party/leveldatabase",
271   ]
273   if (is_win) {
274     deps += [
275       "//base/allocator",
276     ]
277   }