Add remoting and PPAPI tests to GN build
[chromium-blink-merge.git] / content / shell / android / BUILD.gn
blob6d4f89f59617991dbdc66db8a51a7c494bb243d2
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("//build/config/android/config.gni")
6 import("//build/config/android/rules.gni")
7 import("//build/module_args/v8.gni")
8 import("//third_party/icu/config.gni")
10 generate_jni("content_shell_jni_headers") {
11   jni_package = "content/shell"
12   sources = [
13     "browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java",
14     "java/src/org/chromium/content_shell/Shell.java",
15     "java/src/org/chromium/content_shell/ShellLayoutTestUtils.java",
16     "java/src/org/chromium/content_shell/ShellManager.java",
17     "java/src/org/chromium/content_shell/ShellMojoTestUtils.java",
18   ]
21 shared_library("libcontent_shell_content_view") {
22   testonly = true
23   deps = [
24     ":content_shell_jni_headers",
25     "//content/shell:content_shell_lib",
26     "//content/shell:pak",
27     "//components/crash/browser",
28     "//skia",
29     "//media/base/android",
30   ]
31   sources = [
32     "shell_library_loader.cc",
33   ]
34   if (is_android_webview_build) {
35     ldflags = [ "-lgabi++" ]
36   }
39 android_resources("content_shell_java_resources") {
40   testonly = true
41   resource_dirs = [ "java/res" ]
42   custom_package = "org.chromium.content_shell"
45 android_library("content_shell_java") {
46   testonly = true
47   deps = [
48     "//base:base_java",
49     "//content/public/android:content_java",
50     "//media/base/android:media_java",
51     "//net/android:net_java",
52     "//third_party/mojo/src/mojo/public/java:system",
53     "//ui/android:ui_java",
54     ":content_shell_java_resources",
55   ]
56   DEPRECATED_java_in_dir = "java/src"
59 content_shell_manifest =
60     "$target_gen_dir/content_shell_manifest/AndroidManifest.xml"
62 jinja_template("content_shell_manifest") {
63   testonly = true
64   input = "shell_apk/AndroidManifest.xml.jinja2"
65   output = content_shell_manifest
68 android_resources("content_shell_apk_resources") {
69   testonly = true
70   resource_dirs = [ "shell_apk/res" ]
71   deps = [
72     ":content_shell_java_resources",
73   ]
74   android_manifest = content_shell_manifest
77 android_library("content_shell_apk_java") {
78   testonly = true
79   deps = [
80     ":content_shell_apk_resources",
81     ":content_shell_java",
82     "//base:base_java",
83     "//content/public/android:content_java",
84     "//media/base/android:media_java",
85     "//net/android:net_java",
86     "//ui/android:ui_java",
87   ]
88   DEPRECATED_java_in_dir = "shell_apk/src"
91 content_shell_assets_dir = "$root_build_dir/content_shell/assets"
92 copy_ex("copy_content_shell_assets") {
93   clear_dir = true
94   dest = content_shell_assets_dir
95   sources = [
96     "$root_out_dir/content_shell.pak",
97   ]
99   if (icu_use_data_file) {
100     sources += [ "$root_build_dir/icudtl.dat" ]
101   }
102   if (v8_use_external_startup_data) {
103     sources += [
104       "$root_build_dir/natives_blob.bin",
105       "$root_build_dir/snapshot_blob.bin",
106     ]
107   }
110 android_apk("content_shell_apk") {
111   use_chromium_linker = true
112   testonly = true
113   datadeps = [
114     # "//tools/android/forwarder",
115   ]
116   deps = [
117     ":content_shell_apk_resources",
118     ":content_shell_java",
119     ":content_shell_apk_java",
120     ":libcontent_shell_content_view",
121     ":copy_content_shell_assets",
122     "//base:base_java",
123     "//content/public/android:content_java",
124     "//media/base/android:media_java",
125     "//net/android:net_java",
127     #"//third_party/mesa:osmesa_in_lib_dir",
128     "//ui/android:ui_java",
129   ]
130   apk_name = "ContentShell"
131   android_manifest = content_shell_manifest
132   native_libs = [ "libcontent_shell_content_view.so" ]
133   asset_location = content_shell_assets_dir
135   # TODO(GYP)
136   #'extra_native_libs': ['<(SHARED_LIB_DIR)/libosmesa.so'],
138   if (is_android_webview_build) {
139     # TODO(GYP)
140   }
143 android_library("content_shell_test_java") {
144   testonly = true
145   deps = [
146     ":content_shell_java",
147     ":content_shell_apk_java",
148     "//base:base_java",
149     "//base:base_java_test_support",
150     "//content/public/test/android:content_java_test_support",
151     "//content/shell/android:content_shell_java",
152     "//content/public/android:content_java",
153   ]
154   DEPRECATED_java_in_dir = "javatests/src"
157 android_apk("content_shell_test_apk") {
158   testonly = true
159   deps = [
160     "//content/public/android:content_javatests",
161     "//base:base_javatests",
162     "//net/android:net_javatests",
163   ]
164   datadeps = [
165     ":content_shell_apk",
166   ]
167   apk_name = "ContentShellTest"
168   android_manifest = "javatests/AndroidManifest.xml"
171 if (current_cpu != "x64" && current_cpu != "arm64") {
172   chromium_linker_test_manifest =
173       "$target_gen_dir/linker_test_apk/AndroidManifest.xml"
175   jinja_template("chromium_linker_test_manifest") {
176     testonly = true
177     input = "linker_test_apk/AndroidManifest.xml.jinja2"
178     output = chromium_linker_test_manifest
179   }
181   android_resources("linker_resources") {
182     resource_dirs = [ "linker_test_apk/res" ]
183     android_manifest = chromium_linker_test_manifest
184   }
186   # GYP: //content/content_tests.gypi:chromium_linker_test_apk
187   android_apk("chromium_linker_test_apk") {
188     testonly = true
189     deps = [
190       ":content_shell_java",
191       ":copy_content_shell_assets",
192       ":linker_resources",
193       ":linker_test",
194       "//base:base_java",
195       "//content/public/android:content_java",
196       "//ui/android:ui_java",
197     ]
198     android_manifest = chromium_linker_test_manifest
199     asset_location = content_shell_assets_dir
200     apk_name = "ChromiumLinkerTest"
201     DEPRECATED_java_in_dir = "linker_test_apk/src"
202     native_libs = [ "liblinker_test.so" ]
203     use_chromium_linker = true
204     enable_chromium_linker_tests = true
205   }
207   # GYP: //content/content_tests.gypi:chromium_android_linker_test
208   shared_library("linker_test") {
209     testonly = true
210     sources = [
211       "linker_test_apk/chromium_linker_test_android.cc",
212       "linker_test_apk/chromium_linker_test_linker_tests.cc",
213     ]
215     deps = [
216       ":linker_test_jni_headers",
217       "//content/shell:content_shell_lib",
219       # Required to include "content/public/browser/android/compositor.h"
220       # in chromium_linker_test_android.cc :-(
221       "//skia",
222     ]
223   }
225   # GYP: //content/content_tests.gypi:chromium_android_linker_test_jni_headers
226   generate_jni("linker_test_jni_headers") {
227     testonly = true
228     jni_package = "content/shell"
229     sources = [
230       "linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java",
231     ]
232   }