Use own GLHelper for surfaceless, the default one is on a different context
[chromium-blink-merge.git] / extensions / BUILD.gn
blob5280a42945f80d836c657c1be38c0e1f72a79478
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("//extensions/extensions.gni")
6 import("//testing/test.gni")
7 import("//tools/grit/grit_rule.gni")
8 import("//tools/grit/repack.gni")
10 assert(enable_extensions)
12 # GYP version: extensions/extensions_resources.gyp:extensions_resources
13 group("extensions_resources") {
14   deps = [
15     ":extensions_browser_resources",
16     ":extensions_renderer_resources",
17     ":extensions_resources_grd",
18   ]
21 # GYP version: extensions/extensions_resources.gyp:extensions_resources
22 #              (extensions_resources action)
23 grit("extensions_resources_grd") {
24   source = "extensions_resources.grd"
25   outputs = [
26     "grit/extensions_resources.h",
27     "extensions_resources.pak",
28   ]
31 # GYP version: extensions/extensions_resources.gyp:extensions_resources
32 #              (extensions_browser_resources action)
33 grit("extensions_browser_resources") {
34   source = "browser/resources/extensions_browser_resources.grd"
35   outputs = [
36     "grit/extensions_browser_resources.h",
37     "grit/extensions_browser_resources_map.cc",
38     "grit/extensions_browser_resources_map.h",
39     "extensions_browser_resources_100_percent.pak",
40     "extensions_browser_resources_200_percent.pak",
41   ]
42   grit_flags = [
43     "-E",
44     "mojom_root=" + rebase_path(root_gen_dir),
45   ]
48 # GYP version: extensions/extensions_resources.gyp:extensions_resources
49 #              (extensions_renderer_resources action)
50 grit("extensions_renderer_resources") {
51   source = "renderer/resources/extensions_renderer_resources.grd"
52   outputs = [
53     "grit/extensions_renderer_resources.h",
54     "extensions_renderer_resources.pak",
55   ]
56   grit_flags = [
57     "-E",
58     "mojom_root=" + rebase_path(root_gen_dir),
59   ]
61   deps = [
62     "//device/serial:serial_mojo",
63     "//extensions/common:mojo",
64     "//extensions/common/api:mojom",
65   ]
68 source_set("test_support") {
69   testonly = true
70   sources = rebase_path(extensions_gypi_values.extensions_test_support_sources,
71                         ".",
72                         "//extensions")
73   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
74   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
76   deps = [
77     ":extensions_resources",
78     "//base",
79     "//base:prefs_test_support",
80     "//content/public/common",
81     "//content/test:test_support",
82     "//extensions/browser",
83     "//extensions/common",
84     "//extensions/common/api",
85     "//extensions/common/api:api_registration",
86     "//net:test_support",
87     "//testing/gmock",
88     "//testing/gtest",
89   ]
91   public_deps = [
92     "//content/public/browser",
93     "//extensions/common/api/cast_channel:cast_channel_proto",
94   ]
97 # GYP version: //extensions/extensions.gyp:extensions_shell_and_test_pak
98 repack("shell_and_test_pak") {
99   sources = [
100     "$root_gen_dir/blink/public/resources/blink_resources.pak",
101     "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
102     "$root_gen_dir/content/content_resources.pak",
103     "$root_gen_dir/content/shell/shell_resources.pak",
104     "$root_gen_dir/extensions/extensions_browser_resources_100_percent.pak",
105     "$root_gen_dir/extensions/extensions_renderer_resources.pak",
106     "$root_gen_dir/extensions/extensions_resources.pak",
107     "$root_gen_dir/extensions/shell/app_shell_resources.pak",
108     "$root_gen_dir/extensions/strings/extensions_strings_en-US.pak",
109     "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
110     "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
111     "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
112     "$root_gen_dir/blink/devtools_resources.pak",
113   ]
115   output = "$root_out_dir/extensions_shell_and_test.pak"
117   deps = [
118     ":extensions_resources",
119     "//content:resources",
120     "//content/browser/devtools:devtools_resources",
121     "//content/shell:resources",
122     "//extensions/shell:resources",
123     "//extensions/strings",
124     "//third_party/WebKit/public:resources",
125     "//ui/resources",
126     "//ui/strings",
127   ]
130 test("extensions_unittests") {
131   sources =
132       rebase_path(extensions_tests_gypi_values.extensions_unittests_sources,
133                   ".",
134                   "//extensions")
136   sources += [
137     # TODO(rockot): DisplayInfoProvider::Create() is only implemented in Chrome
138     # and app_shell. This is wrong.
139     "shell/browser/shell_display_info_provider.cc",
141     # TODO(rockot): See above, but the header is in //components.
142     "shell/browser/shell_web_contents_modal_dialog_manager.cc",
143   ]
145   deps = [
146     ":extensions_resources",
147     ":shell_and_test_pak",
148     ":test_support",
149     "//base",
150     "//base:prefs_test_support",
151     "//base/test:test_support",
152     "//components/keyed_service/content",
153     "//components/user_prefs",
154     "//content/test:test_support",
155     "//device/bluetooth:mocks",
156     "//device/serial",
157     "//device/serial:test_support",
158     "//extensions/common",
159     "//extensions/common/api/cast_channel:cast_channel_proto",
160     "//extensions/renderer",
161     "//extensions/strings",
162     "//extensions/utility",
163     "//mojo/environment:chromium",
164     "//testing/gmock",
165     "//testing/gtest",
166     "//third_party/leveldatabase",
167     "//third_party/mojo/src/mojo/edk/js",
168     "//third_party/mojo/src/mojo/edk/system",
169     "//third_party/mojo/src/mojo/public/cpp/bindings",
170     "//third_party/mojo/src/mojo/public/interfaces/application",
171   ]
173   if (is_win) {
174     deps += [ "//base/allocator" ]
175   }
177   if (is_chromeos) {
178     sources += [
179       # TODO(rockot): There are two implementations of VpnServiceFactory, a
180       # stub in app_shell and a real one in Chrome. This is wrong.
181       "shell/browser/api/vpn_provider/vpn_service_factory.cc",
182     ]
184     deps += [ "//chromeos:test_support" ]
185   }
188 test("extensions_browsertests") {
189   sources =
190       rebase_path(extensions_tests_gypi_values.extensions_browsertests_sources,
191                   ".",
192                   "//extensions")
194   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
196   deps = [
197     ":test_support",
198     "shell:app_shell_lib",
200     # TODO(yoz): find the right deps
201     "//base",
202     "//base:prefs_test_support",
203     "//base/test:test_support",
204     "//components/storage_monitor:test_support",
205     "//content/test:test_support",
206     "//device/bluetooth:mocks",
207     "//mojo/environment:chromium",
208     "//testing/gmock",
209     "//testing/gtest",
210     "//third_party/mojo/src/mojo/edk/js",
211     "//third_party/mojo/src/mojo/edk/system",
212     "//third_party/mojo/src/mojo/public/cpp/bindings",
213   ]
215   if (is_chromeos) {
216     sources += rebase_path(
217             extensions_tests_gypi_values.extensions_browsertests_sources_chromeos,
218             ".",
219             "//extensions")
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   }