aura: Remove more code that explicitly creates/destroys aura::Env.
[chromium-blink-merge.git] / extensions / BUILD.gn
blob666075aa85eab39edd8c1275e47b93421ed08536
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 # TODO(rockot) bug 505926: Don't include chrome files from here.
6 # See chrome_browser_tests_extensions_sources below
7 import("//chrome/chrome_tests.gni")
8 import("//extensions/extensions.gni")
9 import("//testing/test.gni")
10 import("//tools/grit/grit_rule.gni")
11 import("//tools/grit/repack.gni")
13 assert(enable_extensions)
15 # GYP version: extensions/extensions_resources.gyp:extensions_resources
16 group("extensions_resources") {
17   deps = [
18     ":extensions_browser_resources",
19     ":extensions_renderer_resources",
20     ":extensions_resources_grd",
21   ]
24 # GYP version: extensions/extensions_resources.gyp:extensions_resources
25 #              (extensions_resources action)
26 grit("extensions_resources_grd") {
27   source = "extensions_resources.grd"
28   outputs = [
29     "grit/extensions_resources.h",
30     "extensions_resources.pak",
31   ]
34 # GYP version: extensions/extensions_resources.gyp:extensions_resources
35 #              (extensions_browser_resources action)
36 grit("extensions_browser_resources") {
37   source = "browser/resources/extensions_browser_resources.grd"
38   outputs = [
39     "grit/extensions_browser_resources.h",
40     "grit/extensions_browser_resources_map.cc",
41     "grit/extensions_browser_resources_map.h",
42     "extensions_browser_resources_100_percent.pak",
43     "extensions_browser_resources_200_percent.pak",
44   ]
45   grit_flags = [
46     "-E",
47     "mojom_root=" + rebase_path(root_gen_dir),
48   ]
51 # GYP version: extensions/extensions_resources.gyp:extensions_resources
52 #              (extensions_renderer_resources action)
53 grit("extensions_renderer_resources") {
54   source = "renderer/resources/extensions_renderer_resources.grd"
55   outputs = [
56     "grit/extensions_renderer_resources.h",
57     "extensions_renderer_resources.pak",
58   ]
59   grit_flags = [
60     "-E",
61     "mojom_root=" + rebase_path(root_gen_dir),
62   ]
64   deps = [
65     "//chrome/browser/media/router:mojo_bindings__generator",
66     "//device/serial:serial_mojo__generator",
67     "//extensions/common:mojo__generator",
68     "//extensions/common/api:mojom__generator",
69   ]
72 source_set("test_support") {
73   testonly = true
74   sources = rebase_path(extensions_gypi_values.extensions_test_support_sources,
75                         ".",
76                         "//extensions")
78   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
79   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
81   deps = [
82     ":extensions_resources",
83     "//base",
84     "//base:prefs_test_support",
85     "//components/guest_view/browser:test_support",
86     "//components/pref_registry:test_support",
87     "//content/public/common",
88     "//content/test:test_support",
89     "//extensions/browser",
90     "//extensions/common",
91     "//extensions/common/api",
92     "//extensions/common/api:api_registration",
93     "//net:test_support",
94     "//testing/gmock",
95     "//testing/gtest",
96   ]
98   public_deps = [
99     "//content/public/browser",
100     "//extensions/common/api/cast_channel:cast_channel_proto",
101   ]
104 # GYP version: //extensions/extensions.gyp:extensions_shell_and_test_pak
105 repack("shell_and_test_pak") {
106   sources = [
107     "$root_gen_dir/blink/devtools_resources.pak",
108     "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak",
109     "$root_gen_dir/blink/public/resources/blink_resources.pak",
110     "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
111     "$root_gen_dir/content/content_resources.pak",
112     "$root_gen_dir/content/shell/shell_resources.pak",
113     "$root_gen_dir/extensions/extensions_browser_resources_100_percent.pak",
114     "$root_gen_dir/extensions/extensions_renderer_resources.pak",
115     "$root_gen_dir/extensions/extensions_resources.pak",
116     "$root_gen_dir/extensions/shell/app_shell_resources.pak",
117     "$root_gen_dir/extensions/strings/extensions_strings_en-US.pak",
118     "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
119     "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
120     "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
121   ]
123   output = "$root_out_dir/extensions_shell_and_test.pak"
125   deps = [
126     ":extensions_resources",
127     "//content:resources",
128     "//content/app/strings",
129     "//content/browser/devtools:devtools_resources",
130     "//content/shell:resources",
131     "//extensions/shell:resources",
132     "//extensions/strings",
133     "//third_party/WebKit/public:image_resources",
134     "//third_party/WebKit/public:resources",
135     "//ui/resources",
136     "//ui/strings",
137   ]
140 # TODO(GYP): Delete this after we've converted everything to GN.
141 # The _run targets exist only for compatibility w/ GYP.
142 group("extensions_unittests_run") {
143   testonly = true
144   deps = [
145     ":extensions_unittests",
146   ]
149 test("extensions_unittests") {
150   sources =
151       rebase_path(extensions_tests_gypi_values.extensions_unittests_sources,
152                   ".",
153                   "//extensions")
155   sources += [
156     # TODO(rockot): DisplayInfoProvider::Create() is only implemented in Chrome
157     # and app_shell. This is wrong.
158     "shell/browser/shell_display_info_provider.cc",
159   ]
161   configs += [ "//build/config:precompiled_headers" ]
163   data = [
164     "test/data/",
165     "//chrome/test/data/extensions/",
166     "$root_out_dir/extensions_shell_and_test.pak",
167   ]
169   deps = [
170     ":extensions_resources",
171     ":shell_and_test_pak",
172     ":test_support",
173     "//base",
174     "//base:prefs_test_support",
175     "//base/test:test_support",
176     "//components/keyed_service/content",
177     "//components/pref_registry:test_support",
178     "//components/user_prefs",
179     "//content/test:test_support",
180     "//device/bluetooth:mocks",
181     "//device/serial",
182     "//device/serial:test_support",
183     "//extensions/common",
184     "//extensions/common/api/cast_channel:cast_channel_proto",
185     "//extensions/renderer",
186     "//extensions/strings",
187     "//extensions/utility",
188     "//mojo/application/public/interfaces",
189     "//mojo/environment:chromium",
190     "//testing/gmock",
191     "//testing/gtest",
192     "//third_party/leveldatabase",
193     "//third_party/mojo/src/mojo/edk/js",
194     "//third_party/mojo/src/mojo/edk/system",
195     "//third_party/mojo/src/mojo/public/cpp/bindings",
196   ]
198   data_deps = [ "//third_party/mesa:osmesa" ]
200   if (is_win) {
201     deps += [ "//base/allocator" ]
202   }
204   if (is_chromeos) {
205     sources += [
206       # TODO(rockot): There are two implementations of VpnServiceFactory, a
207       # stub in app_shell and a real one in Chrome. This is wrong.
208       "shell/browser/api/vpn_provider/vpn_service_factory.cc",
209     ]
211     deps += [ "//chromeos:test_support" ]
212   }
215 # TODO(GYP): Delete this after we've converted everything to GN.
216 # The _run targets exist only for compatibility w/ GYP.
217 group("extensions_browsertests_run") {
218   testonly = true
219   deps = [
220     ":extensions_browsertests",
221   ]
224 test("extensions_browsertests") {
225   sources =
226       rebase_path(extensions_tests_gypi_values.extensions_browsertests_sources,
227                   ".",
228                   "//extensions")
230   data = [
231     "test/data/",
232     "//net/data/",
233     "//net/tools/testserver/",
234     "//third_party/pyftpdlib/",
235     "//third_party/pywebsocket/",
236     "//third_party/tlslite/",
237     "$root_out_dir/extensions_shell_and_test.pak",
238   ]
240   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
242   deps = [
243     ":test_support",
244     "shell:app_shell_lib",
246     # TODO(yoz): find the right deps
247     "//base",
248     "//base:prefs_test_support",
249     "//base/test:test_support",
250     "//components/storage_monitor:test_support",
251     "//content/test:test_support",
252     "//device/bluetooth:mocks",
253     "//device/usb:mocks",
254     "//mojo/environment:chromium",
255     "//testing/gmock",
256     "//testing/gtest",
257     "//third_party/mojo/src/mojo/edk/js",
258     "//third_party/mojo/src/mojo/edk/system",
259     "//third_party/mojo/src/mojo/public/cpp/bindings",
260   ]
262   data_deps = [ "//third_party/mesa:osmesa" ]
264   if (is_win) {
265     deps += [ "//base/allocator" ]
267     if (target_cpu == "x86") {
268       data_deps += [
269         # "$root_out_dir/wow_helper.exe"  # TODO(GYP)
270       ]
271     }
272   }
274   if (is_mac) {
275     deps += [ "shell:app_shell" ]  # Needed for App Shell.app's Helper.
276   }
279 # TODO(rockot) bug 505926: These should be moved to extensions_browsertests but have
280 # old dependencies on chrome files. The chrome dependencies should be removed
281 # and these moved to the extensions_browsertests target. Currently, we solve
282 # the problem by making this a source set and linking it into
283 # //chrome/test:browser_tests.
284 source_set("chrome_extensions_browsertests") {
285   testonly = true
286   sources = rebase_path(
287           chrome_tests_gypi_values.chrome_browser_tests_extensions_sources,
288           ".",
289           "//chrome")
291   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
293   # These are the deps from browser_tests minus some internal Chrome ones that
294   # aren't allowed to be included here and that aren't needed.
295   deps = [
296     "//base",
297     "//base:i18n",
298     "//base/allocator",
299     "//base/test:test_support",
300     "//chrome/browser",
301     "//chrome/browser/resources:extension_resource_demo",
302     "//chrome/common/extensions/api",
303     "//chrome/renderer",
304     "//components/autofill/content/browser:risk_proto",
305     "//components/autofill/content/browser/wallet:test_support",
306     "//components/autofill/content/renderer:test_support",
307     "//components/captive_portal:test_support",
308     "//components/dom_distiller/content:content_browser",
309     "//components/dom_distiller/core:test_support",
310     "//components/guest_view/browser:test_support",
311     "//components/resources",
312     "//components/strings",
313     "//components/translate/core/common",
314     "//components/user_manager:test_support",
315     "//crypto:platform",
316     "//crypto:test_support",
317     "//device/bluetooth:mocks",
318     "//device/serial:test_support",
319     "//extensions/common/api",
320     "//google_apis:test_support",
321     "//media",
322     "//media/base:test_support",
323     "//media/cast:test_support",
324     "//net",
325     "//net:test_support",
326     "//sdch",
327     "//skia",
328     "//sync",
329     "//sync:test_support_sync_api",
330     "//testing/gmock",
331     "//testing/gtest",
332     "//testing/perf",
333     "//third_party/cacheinvalidation",
334     "//third_party/icu",
335     "//third_party/leveldatabase",
336     "//third_party/libaddressinput",
337     "//third_party/libjingle",
338     "//third_party/safe_browsing:test_support",
339     "//third_party/WebKit/public:blink",
340     "//third_party/webrtc/modules/desktop_capture",
341     "//third_party/widevine/cdm:version_h",
342     "//ui/accessibility:test_support",
343     "//ui/base:test_support",
344     "//ui/compositor:test_support",
345     "//ui/resources",
346     "//ui/web_dialogs:test_support",
347     "//v8",
348   ]
351 # TODO(rockot) bug 505926: This should be deleted for the same reason as
352 # chrome_extensions_browsertests.
353 source_set("chrome_extensions_interactive_uitests") {
354   testonly = true
355   sources = rebase_path(
356           chrome_tests_gypi_values.chrome_interactive_ui_test_extensions_sources,
357           ".",
358           "//chrome")
360   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
362   # These are the deps from interactive_uitests minus some internal Chrome
363   # ones that aren't allowed to be included here and that aren't needed.
364   deps = [
365     "//base/allocator",
366     "//chrome/browser",
367     "//chrome/browser/devtools",
368     "//chrome/renderer",
369     "//chrome/test:test_support",
370     "//content/app/resources",
371     "//crypto:platform",
372     "//crypto:test_support",
373     "//google_apis:test_support",
374     "//net",
375     "//net:net_resources",
376     "//net:test_support",
377     "//skia",
378     "//sync",
379     "//testing/gmock",
380     "//testing/gtest",
381     "//third_party/hunspell",
382     "//third_party/icu",
383     "//third_party/libpng",
384     "//third_party/zlib",
385     "//ui/base:test_support",
386     "//ui/resources:ui_test_pak",
387     "//ui/web_dialogs:test_support",
388   ]