[Android WebView] Put AndroidStreamReaderURLRequestJob into a namespace
[chromium-blink-merge.git] / extensions / BUILD.gn
blobeaed2b1ef504505680ce9db2001ea10ad9708966
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   public_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   ]
103   if (cld_version == 2) {
104     deps += [ "//third_party/cld_2:cld2_static" ]
105   }
108 # GYP version: //extensions/extensions.gyp:extensions_shell_and_test_pak
109 repack("shell_and_test_pak") {
110   sources = [
111     "$root_gen_dir/blink/devtools_resources.pak",
112     "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak",
113     "$root_gen_dir/blink/public/resources/blink_resources.pak",
114     "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
115     "$root_gen_dir/content/content_resources.pak",
116     "$root_gen_dir/content/shell/shell_resources.pak",
117     "$root_gen_dir/extensions/extensions_browser_resources_100_percent.pak",
118     "$root_gen_dir/extensions/extensions_renderer_resources.pak",
119     "$root_gen_dir/extensions/extensions_resources.pak",
120     "$root_gen_dir/extensions/shell/app_shell_resources.pak",
121     "$root_gen_dir/extensions/strings/extensions_strings_en-US.pak",
122     "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
123     "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
124     "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
125   ]
127   output = "$root_out_dir/extensions_shell_and_test.pak"
129   deps = [
130     ":extensions_resources",
131     "//content:resources",
132     "//content/app/strings",
133     "//content/browser/devtools:devtools_resources",
134     "//content/shell:resources",
135     "//extensions/shell:resources",
136     "//extensions/strings",
137     "//third_party/WebKit/public:image_resources",
138     "//third_party/WebKit/public:resources",
139     "//ui/resources",
140     "//ui/strings",
141   ]
144 # TODO(GYP): Delete this after we've converted everything to GN.
145 # The _run targets exist only for compatibility w/ GYP.
146 group("extensions_unittests_run") {
147   testonly = true
148   deps = [
149     ":extensions_unittests",
150   ]
153 test("extensions_unittests") {
154   sources =
155       rebase_path(extensions_tests_gypi_values.extensions_unittests_sources,
156                   ".",
157                   "//extensions")
159   sources += [
160     # TODO(rockot): DisplayInfoProvider::Create() is only implemented in Chrome
161     # and app_shell. This is wrong.
162     "shell/browser/shell_display_info_provider.cc",
163   ]
165   configs += [ "//build/config:precompiled_headers" ]
167   data = [
168     "test/data/",
169     "//chrome/test/data/extensions/",
170     "$root_out_dir/extensions_shell_and_test.pak",
171   ]
173   deps = [
174     ":extensions_resources",
175     ":shell_and_test_pak",
176     ":test_support",
177     "//base",
178     "//base:prefs_test_support",
179     "//base/test:test_support",
180     "//components/keyed_service/content",
181     "//components/pref_registry:test_support",
182     "//components/user_prefs",
183     "//content/test:test_support",
184     "//device/bluetooth:mocks",
185     "//device/core",
186     "//device/hid",
187     "//device/serial",
188     "//device/serial:test_support",
189     "//extensions/common",
190     "//extensions/common/api/cast_channel:cast_channel_proto",
191     "//extensions/renderer",
192     "//extensions/strings",
193     "//extensions/utility",
194     "//mojo/application/public/interfaces",
195     "//mojo/environment:chromium",
196     "//testing/gmock",
197     "//testing/gtest",
198     "//third_party/leveldatabase",
199     "//third_party/mojo/src/mojo/edk/js",
200     "//third_party/mojo/src/mojo/edk/system",
201     "//third_party/mojo/src/mojo/public/cpp/bindings",
202   ]
204   data_deps = [ "//third_party/mesa:osmesa" ]
206   if (is_win) {
207     deps += [ "//base/allocator" ]
208   }
210   if (is_chromeos) {
211     sources += [
212       # TODO(rockot): There are two implementations of VpnServiceFactory, a
213       # stub in app_shell and a real one in Chrome. This is wrong.
214       "shell/browser/api/vpn_provider/vpn_service_factory.cc",
215     ]
217     deps += [ "//chromeos:test_support" ]
218   }
221 # TODO(GYP): Delete this after we've converted everything to GN.
222 # The _run targets exist only for compatibility w/ GYP.
223 group("extensions_browsertests_run") {
224   testonly = true
225   deps = [
226     ":extensions_browsertests",
227   ]
230 test("extensions_browsertests") {
231   sources =
232       rebase_path(extensions_tests_gypi_values.extensions_browsertests_sources,
233                   ".",
234                   "//extensions")
236   data = [
237     "test/data/",
238     "//net/data/",
239     "//net/tools/testserver/",
240     "//third_party/pyftpdlib/",
241     "//third_party/pywebsocket/",
242     "//third_party/tlslite/",
243     "$root_out_dir/extensions_shell_and_test.pak",
244   ]
246   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
248   deps = [
249     ":test_support",
250     "shell:app_shell_lib",
252     # TODO(yoz): find the right deps
253     "//base",
254     "//base:prefs_test_support",
255     "//base/test:test_support",
256     "//components/storage_monitor:test_support",
257     "//content/test:test_support",
258     "//device/bluetooth:mocks",
259     "//device/usb:mocks",
260     "//mojo/environment:chromium",
261     "//testing/gmock",
262     "//testing/gtest",
263     "//third_party/mojo/src/mojo/edk/js",
264     "//third_party/mojo/src/mojo/edk/system",
265     "//third_party/mojo/src/mojo/public/cpp/bindings",
266   ]
268   data_deps = [ "//third_party/mesa:osmesa" ]
270   if (is_win) {
271     deps += [ "//base/allocator" ]
273     if (target_cpu == "x86") {
274       data_deps += [
275         # "$root_out_dir/wow_helper.exe"  # TODO(GYP)
276       ]
277     }
278   }
280   if (is_mac) {
281     deps += [ "shell:app_shell" ]  # Needed for App Shell.app's Helper.
282   }
285 # TODO(rockot) bug 505926: These should be moved to extensions_browsertests but have
286 # old dependencies on chrome files. The chrome dependencies should be removed
287 # and these moved to the extensions_browsertests target. Currently, we solve
288 # the problem by making this a source set and linking it into
289 # //chrome/test:browser_tests.
290 source_set("chrome_extensions_browsertests") {
291   testonly = true
292   sources = rebase_path(
293           chrome_tests_gypi_values.chrome_browser_tests_extensions_sources,
294           ".",
295           "//chrome")
297   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
299   # These are the deps from browser_tests minus some internal Chrome ones that
300   # aren't allowed to be included here and that aren't needed.
301   deps = [
302     "//base",
303     "//base:i18n",
304     "//base/allocator",
305     "//base/test:test_support",
306     "//chrome/browser",
307     "//chrome/browser/resources:extension_resource_demo",
308     "//chrome/common/extensions/api",
309     "//chrome/renderer",
310     "//components/autofill/content/browser:risk_proto",
311     "//components/autofill/content/browser/wallet:test_support",
312     "//components/autofill/content/renderer:test_support",
313     "//components/captive_portal:test_support",
314     "//components/dom_distiller/content:content_browser",
315     "//components/dom_distiller/core:test_support",
316     "//components/guest_view/browser:test_support",
317     "//components/resources",
318     "//components/strings",
319     "//components/translate/core/common",
320     "//components/user_manager:test_support",
321     "//crypto:platform",
322     "//crypto:test_support",
323     "//device/bluetooth:mocks",
324     "//device/serial:test_support",
325     "//extensions/common/api",
326     "//google_apis:test_support",
327     "//media",
328     "//media/base:test_support",
329     "//media/cast:test_support",
330     "//net",
331     "//net:test_support",
332     "//sdch",
333     "//skia",
334     "//sync",
335     "//sync:test_support_sync_api",
336     "//testing/gmock",
337     "//testing/gtest",
338     "//testing/perf",
339     "//third_party/cacheinvalidation",
340     "//third_party/icu",
341     "//third_party/leveldatabase",
342     "//third_party/libaddressinput",
343     "//third_party/libjingle",
344     "//third_party/safe_browsing:test_support",
345     "//third_party/WebKit/public:blink",
346     "//third_party/webrtc/modules/desktop_capture",
347     "//third_party/widevine/cdm:version_h",
348     "//ui/accessibility:test_support",
349     "//ui/base:test_support",
350     "//ui/compositor:test_support",
351     "//ui/resources",
352     "//ui/web_dialogs:test_support",
353     "//v8",
354   ]
357 # TODO(rockot) bug 505926: This should be deleted for the same reason as
358 # chrome_extensions_browsertests.
359 source_set("chrome_extensions_interactive_uitests") {
360   testonly = true
361   sources = rebase_path(
362           chrome_tests_gypi_values.chrome_interactive_ui_test_extensions_sources,
363           ".",
364           "//chrome")
366   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
368   # These are the deps from interactive_uitests minus some internal Chrome
369   # ones that aren't allowed to be included here and that aren't needed.
370   deps = [
371     "//base/allocator",
372     "//chrome/browser",
373     "//chrome/browser/devtools",
374     "//chrome/renderer",
375     "//chrome/test:test_support",
376     "//content/app/resources",
377     "//crypto:platform",
378     "//crypto:test_support",
379     "//google_apis:test_support",
380     "//net",
381     "//net:net_resources",
382     "//net:test_support",
383     "//skia",
384     "//sync",
385     "//testing/gmock",
386     "//testing/gtest",
387     "//third_party/hunspell",
388     "//third_party/icu",
389     "//third_party/libpng",
390     "//third_party/zlib",
391     "//ui/base:test_support",
392     "//ui/resources:ui_test_pak",
393     "//ui/web_dialogs:test_support",
394   ]