Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / extensions / BUILD.gn
blobd64840dcd588b19d402f022fe86849a28b136cba
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     "//content/public/common",
87     "//content/test:test_support",
88     "//extensions/browser",
89     "//extensions/common",
90     "//extensions/common/api",
91     "//extensions/common/api:api_registration",
92     "//net:test_support",
93     "//testing/gmock",
94     "//testing/gtest",
95   ]
97   public_deps = [
98     "//content/public/browser",
99     "//extensions/common/api/cast_channel:cast_channel_proto",
100   ]
103 # GYP version: //extensions/extensions.gyp:extensions_shell_and_test_pak
104 repack("shell_and_test_pak") {
105   sources = [
106     "$root_gen_dir/blink/devtools_resources.pak",
107     "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak",
108     "$root_gen_dir/blink/public/resources/blink_resources.pak",
109     "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
110     "$root_gen_dir/content/content_resources.pak",
111     "$root_gen_dir/content/shell/shell_resources.pak",
112     "$root_gen_dir/extensions/extensions_browser_resources_100_percent.pak",
113     "$root_gen_dir/extensions/extensions_renderer_resources.pak",
114     "$root_gen_dir/extensions/extensions_resources.pak",
115     "$root_gen_dir/extensions/shell/app_shell_resources.pak",
116     "$root_gen_dir/extensions/strings/extensions_strings_en-US.pak",
117     "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
118     "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
119     "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
120   ]
122   output = "$root_out_dir/extensions_shell_and_test.pak"
124   deps = [
125     ":extensions_resources",
126     "//content:resources",
127     "//content/app/strings",
128     "//content/browser/devtools:devtools_resources",
129     "//content/shell:resources",
130     "//extensions/shell:resources",
131     "//extensions/strings",
132     "//third_party/WebKit/public:image_resources",
133     "//third_party/WebKit/public:resources",
134     "//ui/resources",
135     "//ui/strings",
136   ]
139 test("extensions_unittests") {
140   sources =
141       rebase_path(extensions_tests_gypi_values.extensions_unittests_sources,
142                   ".",
143                   "//extensions")
145   sources += [
146     # TODO(rockot): DisplayInfoProvider::Create() is only implemented in Chrome
147     # and app_shell. This is wrong.
148     "shell/browser/shell_display_info_provider.cc",
149   ]
151   deps = [
152     ":extensions_resources",
153     ":shell_and_test_pak",
154     ":test_support",
155     "//base",
156     "//base:prefs_test_support",
157     "//base/test:test_support",
158     "//components/keyed_service/content",
159     "//components/user_prefs",
160     "//content/test:test_support",
161     "//device/bluetooth:mocks",
162     "//device/serial",
163     "//device/serial:test_support",
164     "//extensions/common",
165     "//extensions/common/api/cast_channel:cast_channel_proto",
166     "//extensions/renderer",
167     "//extensions/strings",
168     "//extensions/utility",
169     "//mojo/application/public/interfaces",
170     "//mojo/environment:chromium",
171     "//testing/gmock",
172     "//testing/gtest",
173     "//third_party/leveldatabase",
174     "//third_party/mojo/src/mojo/edk/js",
175     "//third_party/mojo/src/mojo/edk/system",
176     "//third_party/mojo/src/mojo/public/cpp/bindings",
177   ]
179   if (is_win) {
180     deps += [ "//base/allocator" ]
181   }
183   if (is_chromeos) {
184     sources += [
185       # TODO(rockot): There are two implementations of VpnServiceFactory, a
186       # stub in app_shell and a real one in Chrome. This is wrong.
187       "shell/browser/api/vpn_provider/vpn_service_factory.cc",
188     ]
190     deps += [ "//chromeos:test_support" ]
191   }
194 test("extensions_browsertests") {
195   sources =
196       rebase_path(extensions_tests_gypi_values.extensions_browsertests_sources,
197                   ".",
198                   "//extensions")
200   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
202   deps = [
203     ":test_support",
204     "shell:app_shell_lib",
206     # TODO(yoz): find the right deps
207     "//base",
208     "//base:prefs_test_support",
209     "//base/test:test_support",
210     "//components/storage_monitor:test_support",
211     "//content/test:test_support",
212     "//device/bluetooth:mocks",
213     "//device/usb:mocks",
214     "//mojo/environment:chromium",
215     "//testing/gmock",
216     "//testing/gtest",
217     "//third_party/mojo/src/mojo/edk/js",
218     "//third_party/mojo/src/mojo/edk/system",
219     "//third_party/mojo/src/mojo/public/cpp/bindings",
220   ]
222   if (is_win) {
223     deps += [ "//base/allocator" ]
224   }
226   if (is_mac) {
227     deps += [ "shell:app_shell" ]  # Needed for App Shell.app's Helper.
228   }
231 # TODO(rockot) bug 505926: These should be moved to extensions_browsertests but have
232 # old dependencies on chrome files. The chrome dependencies should be removed
233 # and these moved to the extensions_browsertests target. Currently, we solve
234 # the problem by making this a source set and linking it into
235 # //chrome/test:browser_tests.
236 source_set("chrome_extensions_browsertests") {
237   testonly = true
238   sources = rebase_path(
239           chrome_tests_gypi_values.chrome_browser_tests_extensions_sources,
240           ".",
241           "//chrome")
243   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
245   # These are the deps from browser_tests minus some internal Chrome ones that
246   # aren't allowed to be included here and that aren't needed.
247   deps = [
248     "//base",
249     "//base:i18n",
250     "//base/allocator",
251     "//base/test:test_support",
252     "//chrome/browser",
253     "//chrome/browser/resources:extension_resource_demo",
254     "//chrome/common/extensions/api",
255     "//chrome/renderer",
256     "//components/autofill/content/browser:risk_proto",
257     "//components/autofill/content/browser/wallet:test_support",
258     "//components/autofill/content/renderer:test_support",
259     "//components/captive_portal:test_support",
260     "//components/dom_distiller/content:content_browser",
261     "//components/dom_distiller/core:test_support",
262     "//components/guest_view/browser:test_support",
263     "//components/resources",
264     "//components/strings",
265     "//components/translate/core/common",
266     "//components/user_manager:test_support",
267     "//crypto:platform",
268     "//crypto:test_support",
269     "//device/bluetooth:mocks",
270     "//device/serial:test_support",
271     "//extensions/common/api",
272     "//google_apis:test_support",
273     "//media",
274     "//media/base:test_support",
275     "//media/cast:test_support",
276     "//net",
277     "//net:test_support",
278     "//sdch",
279     "//skia",
280     "//sync",
281     "//sync:test_support_sync_api",
282     "//testing/gmock",
283     "//testing/gtest",
284     "//testing/perf",
285     "//third_party/cacheinvalidation",
286     "//third_party/icu",
287     "//third_party/leveldatabase",
288     "//third_party/libaddressinput",
289     "//third_party/libjingle",
290     "//third_party/safe_browsing:test_support",
291     "//third_party/WebKit/public:blink",
292     "//third_party/webrtc/modules/desktop_capture",
293     "//third_party/widevine/cdm:version_h",
294     "//ui/accessibility:test_support",
295     "//ui/base:test_support",
296     "//ui/compositor:test_support",
297     "//ui/resources",
298     "//ui/web_dialogs:test_support",
299     "//v8",
300   ]
303 # TODO(rockot) bug 505926: This should be deleted for the same reason as
304 # chrome_extensions_browsertests.
305 source_set("chrome_extensions_interactive_uitests") {
306   testonly = true
307   sources = rebase_path(
308           chrome_tests_gypi_values.chrome_interactive_ui_test_extensions_sources,
309           ".",
310           "//chrome")
312   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
314   # These are the deps from interactive_uitests minus some internal Chrome
315   # ones that aren't allowed to be included here and that aren't needed.
316   deps = [
317     "//base/allocator",
318     "//chrome/browser",
319     "//chrome/browser/devtools",
320     "//chrome/renderer",
321     "//chrome/test:test_support",
322     "//content/app/resources",
323     "//crypto:platform",
324     "//crypto:test_support",
325     "//google_apis:test_support",
326     "//net",
327     "//net:net_resources",
328     "//net:test_support",
329     "//skia",
330     "//sync",
331     "//testing/gmock",
332     "//testing/gtest",
333     "//third_party/hunspell",
334     "//third_party/icu",
335     "//third_party/libpng",
336     "//third_party/zlib",
337     "//ui/base:test_support",
338     "//ui/resources:ui_test_pak",
339     "//ui/web_dialogs:test_support",
340   ]