Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / extensions / BUILD.gn
blobd2b733f8c1588519c7eee88cc6a0a2256a958da4
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 #              (extensions_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     "//extensions/common/api:api_registration",
79     "//net:test_support",
80     "//testing/gmock",
81     "//testing/gtest",
82   ]
84   if (is_win) {
85     cflags = [
86       "/wd4267", # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
87     ]
88   }
92 # GYP version: //extensions/extensions.gyp:extensions_shell_and_test_pak
93 repack("shell_and_test_pak") {
94   sources = [
95     "$root_gen_dir/chrome/common_resources.pak",
96     "$root_gen_dir/chrome/extensions_api_resources.pak",
97     # TODO(jamescook): Extract the extension/app related resources
98     # from generated_resources_en-US.pak. http://crbug.com/397250
99     "$root_gen_dir/chrome/generated_resources_en-US.pak",
100     "$root_gen_dir/chrome/renderer_resources_100_percent.pak",
101     "$root_gen_dir/content/content_resources.pak",
102     "$root_gen_dir/content/shell/shell_resources.pak",
103     "$root_gen_dir/extensions/extensions_renderer_resources.pak",
104     "$root_gen_dir/extensions/extensions_resources.pak",
105     "$root_gen_dir/extensions/shell/app_shell_resources.pak",
106     "$root_gen_dir/extensions/strings/extensions_strings_en-US.pak",
107     "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
108     "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
109     "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
110     "$root_gen_dir/webkit/devtools_resources.pak",
111   ]
113   output = "$root_out_dir/extensions_shell_and_test.pak"
115   deps = [
116     ":extensions_resources",
117     # Need extension related resources in common_resources.pak and
118     # renderer_resources_100_percent.pak
119     "//chrome:resources",
120     # Need dev-tools related resources in shell_resources.pak and
121     # devtools_resources.pak.
122     "//content/browser/devtools:resources",
123     "//content/shell:resources",
124     "//content:resources",
125     "//extensions/shell:resources",
126     "//extensions/strings",
127     "//ui/resources",
128     "//ui/strings",
129   ]
132 # TODO(GYP): Enable this link errors are fixed.
133 if (false) {
134 # TODO(tfarina): Many extension unit tests run as part of Chrome"s
135 # unit_tests target. They should be moved here, which may require some
136 # refactoring (ExtensionsBrowserClient, TestingProfile, etc.).
137 # http://crbug.com/348066
138 test("unittests") {
139   output_name = "extensions_unittests"
141   sources = [
142     "browser/info_map_unittest.cc",
143     "browser/process_manager_unittest.cc",
144     "common/api/sockets/sockets_manifest_permission_unittest.cc",
145     "common/csp_validator_unittest.cc",
146     "common/event_filter_unittest.cc",
147     "common/extension_resource_unittest.cc",
148     "common/extension_set_unittest.cc",
149     "common/manifest_handler_unittest.cc",
150     "common/message_bundle_unittest.cc",
151     "common/one_shot_event_unittest.cc",
152     "common/permissions/manifest_permission_set_unittest.cc",
153     "common/url_pattern_set_unittest.cc",
154     "common/url_pattern_unittest.cc",
155     "common/user_script_unittest.cc",
156     "renderer/activity_log_converter_strategy_unittest.cc",
157     "renderer/api/serial/data_receiver_unittest.cc",
158     "renderer/api/serial/data_sender_unittest.cc",
159     "renderer/api/serial/serial_api_unittest.cc",
160     "renderer/api_test_base.cc",
161     "renderer/api_test_base.h",
162     "renderer/api_test_base_unittest.cc",
163     "renderer/event_unittest.cc",
164     "renderer/json_schema_unittest.cc",
165     "renderer/messaging_utils_unittest.cc",
166     "renderer/module_system_test.cc",
167     "renderer/module_system_test.h",
168     "renderer/module_system_unittest.cc",
169     "renderer/safe_builtins_unittest.cc",
170     "renderer/script_context_set_unittest.cc",
171     "renderer/utils_unittest.cc",
172     "test/extensions_unittests_main.cc",
175   deps = [
176     ":extensions_resources",
177     ":shell_and_test_pak",
178     ":test_support",
179     "//base",
180     "//base/test:test_support",
181     "//content/test:test_support",
182     "//device/serial",
183     "//device/serial:test_util",
184     "//extensions/common",
185     "//extensions/renderer",
186     "//extensions/strings",
187     "//mojo/environment:chromium",
188     "//mojo/public/cpp/bindings",
189     "//mojo/bindings/js",
190     "//mojo/system",
191     "//testing/gmock",
192     "//testing/gtest",
193   ]
195   if (is_win) {
196     deps += [
197       "//base/allocator",
198     ]
199   }