Update mojo surfaces bindings and mojo/cc/ glue
[chromium-blink-merge.git] / extensions / BUILD.gn
blob3eba645abb9a159c97b6db1590ff804005b27ab4
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_renderer_resources",
12     ":extensions_resources_grd",
13   ]
16 # GYP version: extensions/extensions_resources.gyp:extensions_resources
17 #              (exntensions_resources action)
18 grit("extensions_resources_grd") {
19   source = "extensions_resources.grd"
20   outputs = [
21     "grit/extensions_resources.h",
22     "extensions_resources.pak",
23   ]
26 # GYP version: extensions/extensions_resources.gyp:extensions_resources
27 #              (exntensions_renderer_resources action)
28 grit("extensions_renderer_resources") {
29   source = "renderer/resources/extensions_renderer_resources.grd"
30   outputs = [
31     "grit/extensions_renderer_resources.h",
32     "extensions_renderer_resources.pak",
33   ]
34   grit_flags = [ "-E", "mojom_root=" + rebase_path(root_gen_dir) ]
35   if (enable_extensions) {
36     deps = [
37       "//device/serial:serial_mojo",
38     ]
39   }
42 source_set("test_support") {
43   sources = [
44     "browser/api/dns/mock_host_resolver_creator.cc",
45     "browser/api/dns/mock_host_resolver_creator.h",
46     "browser/api_test_utils.cc",
47     "browser/api_test_utils.h",
48     "browser/extensions_test.cc",
49     "browser/extensions_test.h",
50     "browser/test_extensions_browser_client.cc",
51     "browser/test_extensions_browser_client.h",
52     "browser/test_management_policy.cc",
53     "browser/test_management_policy.h",
54     "browser/test_runtime_api_delegate.cc",
55     "browser/test_runtime_api_delegate.h",
56     "common/extension_builder.cc",
57     "common/extension_builder.h",
58     "common/test_util.cc",
59     "common/test_util.h",
60     "common/value_builder.cc",
61     "common/value_builder.h",
62     "renderer/test_extensions_renderer_client.cc",
63     "renderer/test_extensions_renderer_client.h",
64     "test/test_extensions_client.cc",
65     "test/test_extensions_client.h",
66     "test/test_permission_message_provider.cc",
67     "test/test_permission_message_provider.h",
68     "test/test_permissions_provider.cc",
69     "test/test_permissions_provider.h",
70    ]
72   deps = [
73     ":extensions_resources",
74     "//base",
75     "//extensions/browser",
76     "//extensions/common",
77     "//extensions/common/api",
78     "//net:test_support",
79     "//testing/gmock",
80     "//testing/gtest",
81   ]
83   if (is_win) {
84     cflags = [
85       "/wd4267", # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
86     ]
87   }
91 # GYP version: //extensions/extensions.gyp:extensions_shell_and_test_pak
92 repack("shell_and_test_pak") {
93   sources = [
94     "$root_gen_dir/chrome/common_resources.pak",
95     "$root_gen_dir/chrome/extensions_api_resources.pak",
96     # TODO(jamescook): Extract the extension/app related resources
97     # from generated_resources_en-US.pak. http://crbug.com/397250
98     "$root_gen_dir/chrome/generated_resources_en-US.pak",
99     "$root_gen_dir/chrome/renderer_resources_100_percent.pak",
100     "$root_gen_dir/content/content_resources.pak",
101     "$root_gen_dir/content/shell/shell_resources.pak",
102     "$root_gen_dir/extensions/extensions_renderer_resources.pak",
103     "$root_gen_dir/extensions/extensions_resources.pak",
104     "$root_gen_dir/extensions/shell/app_shell_resources.pak",
105     "$root_gen_dir/extensions/strings/extensions_strings_en-US.pak",
106     "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
107     "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
108     "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
109     "$root_gen_dir/webkit/devtools_resources.pak",
110   ]
112   output = "$root_out_dir/extensions_shell_and_test.pak"
114   deps = [
115     ":extensions_resources",
116     # Need extension related resources in common_resources.pak and
117     # renderer_resources_100_percent.pak
118     "//chrome:resources",
119     # Need dev-tools related resources in shell_resources.pak and
120     # devtools_resources.pak.
121     "//content/browser/devtools:resources",
122     "//content/shell:resources",
123     "//content:resources",
124     "//extensions/shell:resources",
125     "//extensions/strings",
126     "//ui/resources",
127     "//ui/strings",
128   ]
131 # TODO(GYP): Enable this link errors are fixed.
132 if (false) {
133 # TODO(tfarina): Many extension unit tests run as part of Chrome"s
134 # unit_tests target. They should be moved here, which may require some
135 # refactoring (ExtensionsBrowserClient, TestingProfile, etc.).
136 # http://crbug.com/348066
137 test("unittests") {
138   output_name = "extensions_unittests"
140   sources = [
141     "browser/info_map_unittest.cc",
142     "browser/process_manager_unittest.cc",
143     "common/api/sockets/sockets_manifest_permission_unittest.cc",
144     "common/csp_validator_unittest.cc",
145     "common/event_filter_unittest.cc",
146     "common/extension_resource_unittest.cc",
147     "common/extension_set_unittest.cc",
148     "common/manifest_handler_unittest.cc",
149     "common/message_bundle_unittest.cc",
150     "common/one_shot_event_unittest.cc",
151     "common/permissions/manifest_permission_set_unittest.cc",
152     "common/url_pattern_set_unittest.cc",
153     "common/url_pattern_unittest.cc",
154     "common/user_script_unittest.cc",
155     "renderer/activity_log_converter_strategy_unittest.cc",
156     "renderer/api/serial/data_receiver_unittest.cc",
157     "renderer/api/serial/data_sender_unittest.cc",
158     "renderer/api/serial/serial_api_unittest.cc",
159     "renderer/api_test_base.cc",
160     "renderer/api_test_base.h",
161     "renderer/api_test_base_unittest.cc",
162     "renderer/event_unittest.cc",
163     "renderer/json_schema_unittest.cc",
164     "renderer/messaging_utils_unittest.cc",
165     "renderer/module_system_test.cc",
166     "renderer/module_system_test.h",
167     "renderer/module_system_unittest.cc",
168     "renderer/safe_builtins_unittest.cc",
169     "renderer/script_context_set_unittest.cc",
170     "renderer/utils_unittest.cc",
171     "test/extensions_unittests_main.cc",
174   deps = [
175     ":extensions_resources",
176     ":shell_and_test_pak",
177     ":test_support",
178     "//base",
179     "//base/test:test_support",
180     "//content/test:test_support",
181     "//device/serial",
182     "//device/serial:test_util",
183     "//extensions/common",
184     "//extensions/renderer",
185     "//extensions/strings",
186     "//mojo/environment:chromium",
187     "//mojo/public/cpp/bindings",
188     "//mojo/bindings/js",
189     "//mojo/system",
190     "//testing/gmock",
191     "//testing/gtest",
192   ]
194   if (is_win) {
195     deps += [
196       "//base/allocator",
197     ]
198   }