blob: bf80a1a5c3d7e51f9a744d335da66f1f746bd615 [file] [log] [blame]
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//third_party/icu/config.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
content_shell_manifest =
"$target_gen_dir/content_shell_manifest/AndroidManifest.xml"
generate_jni("content_shell_jni_headers") {
sources = [
"java/src/org/chromium/content_shell/Shell.java",
"java/src/org/chromium/content_shell/ShellManager.java",
]
}
shared_library("libcontent_shell_content_view") {
testonly = true
deps = [
":content_shell_jni_headers",
"//components/crash/content/browser",
"//content/shell:content_shell_lib",
"//content/shell:pak",
"//media",
"//skia",
]
# Explicit dependency required for JNI registration to be able to
# find the native side functions.
if (is_component_build) {
deps += [
"//device/gamepad",
"//media/midi",
]
}
sources = [
"shell_library_loader.cc",
]
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
configs += [ "//build/config/android:hide_all_but_jni" ]
}
shared_library("libcontent_native_test") {
testonly = true
deps = [
"//base",
"//content/public/test/android:content_native_test_support",
"//content/shell:content_shell_lib",
]
sources = [
"shell_test_library_loader.cc",
]
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
configs += [ "//build/config/android:hide_all_but_jni" ]
}
android_resources("content_shell_java_resources") {
testonly = true
resource_dirs = [ "java/res" ]
custom_package = "org.chromium.content_shell"
}
android_library("content_shell_java") {
testonly = true
deps = [
":content_shell_java_resources",
":content_shell_manifest",
"//base:base_java",
"//components/download/internal/common:internal_java",
"//components/embedder_support/android:content_view_java",
"//components/embedder_support/android:view_java",
"//components/viz/service:service_java",
"//content/public/android:content_java",
"//media/base/android:media_java",
"//media/capture/video/android:capture_java",
"//mojo/public/java:system_java",
"//net/android:net_java",
"//ui/android:ui_java",
]
java_files = [
"java/src/org/chromium/content_shell/Shell.java",
"java/src/org/chromium/content_shell/ShellManager.java",
"java/src/org/chromium/content_shell/ShellViewAndroidDelegate.java",
]
android_manifest_for_lint = content_shell_manifest
}
jinja_template("content_shell_manifest") {
testonly = true
input = "shell_apk/AndroidManifest.xml.jinja2"
output = content_shell_manifest
}
android_resources("content_shell_apk_resources") {
testonly = true
resource_dirs = [ "shell_apk/res" ]
deps = [
":content_shell_java_resources",
]
android_manifest = content_shell_manifest
android_manifest_dep = ":content_shell_manifest"
}
android_library("content_shell_apk_java") {
testonly = true
srcjar_deps = [ ":content_javatests_aidl" ]
deps = [
":content_shell_apk_resources",
":content_shell_java",
":content_shell_manifest",
"//base:base_java",
"//components/embedder_support/android:view_java",
"//content/public/android:content_java",
"//media/capture/video/android:capture_java",
"//net/android:net_java",
"//third_party/jsr-305:jsr_305_javalib",
"//ui/android:ui_java",
]
android_manifest_for_lint = content_shell_manifest
java_files = [
"shell_apk/src/org/chromium/content_shell_apk/ChildProcessLauncherTestHelperService.java",
"shell_apk/src/org/chromium/content_shell_apk/ChildProcessLauncherTestUtils.java",
"shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java",
"shell_apk/src/org/chromium/content_shell_apk/ContentShellApplication.java",
"shell_apk/src/org/chromium/content_shell_apk/TestChildProcessService.java",
"shell_apk/src/org/chromium/content_shell_apk/TestChildProcessService0.java",
"shell_apk/src/org/chromium/content_shell_apk/TestChildProcessService1.java",
]
}
android_aidl("content_javatests_aidl") {
import_include = [ "shell_apk/src" ]
sources = [
"shell_apk/src/org/chromium/content_shell_apk/IChildProcessTest.aidl",
]
}
android_assets("content_shell_assets") {
testonly = true
sources = [
"$root_out_dir/content_shell.pak",
]
disable_compression = true
deps = [
"//content/shell:pak",
"//third_party/icu:icu_assets",
]
if (use_v8_context_snapshot) {
deps += [ "//tools/v8_context_snapshot:v8_context_snapshot_assets" ]
} else {
deps += [ "//v8:v8_external_startup_data_assets" ]
}
}
android_apk("content_shell_apk") {
testonly = true
deps = [
":content_shell_apk_java",
":content_shell_assets",
":content_shell_java",
"//base:base_java",
"//base:base_java_test_support",
"//components/crash/android:java",
"//components/crash/content/app:chrome_crashpad_handler_named_as_so",
"//content/public/android:content_java",
"//content/public/test/android:android_test_message_pump_support_java",
"//media/capture/video/android:capture_java",
"//net/android:net_java",
"//services/shape_detection:shape_detection_java",
"//third_party/mesa_headers",
"//ui/android:ui_java",
]
apk_name = "ContentShell"
android_manifest = content_shell_manifest
android_manifest_dep = ":content_shell_manifest"
shared_libraries = [ ":libcontent_shell_content_view" ]
loadable_modules = [ "$root_out_dir/libchrome_crashpad_handler.so" ]
command_line_flags_file = "content-shell-command-line"
}
android_library("content_shell_test_java") {
testonly = true
deps = [
":content_shell_apk_java",
":content_shell_java",
"//base:base_java",
"//base:base_java_test_support",
"//content/public/android:content_java",
"//content/public/test/android:content_java_test_support",
"//content/shell/android:content_shell_java",
"//mojo/public/java/system:test_support_java",
"//third_party/android_support_test_runner:rules_java",
"//third_party/android_support_test_runner:runner_java",
"//third_party/junit:junit",
"//ui/android:ui_java",
]
java_files = [
"javatests/src/org/chromium/content_shell_apk/ContentShellPreconditionsTest.java",
"javatests/src/org/chromium/content_shell_apk/ContentShellShellManagementTest.java",
"javatests/src/org/chromium/content_shell_apk/ContentShellActivityTestRule.java",
"javatests/src/org/chromium/content_shell_apk/ContentShellUrlTest.java",
]
}
instrumentation_test_apk("content_shell_test_apk") {
deps = [
"//base:base_java_test_support",
"//base:base_javatests",
"//content/public/android:content_javatests",
"//net/android:net_javatests",
"//third_party/android_support_test_runner:runner_java",
]
apk_under_test = ":content_shell_apk"
apk_name = "ContentShellTest"
# Explicitly disabling multidex since there are build errors with this
# apk_under_test providing the same classes as the instrumentation_test_apk.
enable_multidex = false
shared_libraries = [ ":libcontent_native_test" ]
android_manifest = "javatests/AndroidManifest.xml"
if (enable_chrome_android_internal) {
data_deps = [
"//clank/build/bot/filters:content_shell_test_apk_filters",
]
}
}
if (current_cpu != "x64") {
chromium_linker_test_manifest =
"$target_gen_dir/linker_test_apk/AndroidManifest.xml"
jinja_template("chromium_linker_test_manifest") {
testonly = true
input = "linker_test_apk/AndroidManifest.xml.jinja2"
output = chromium_linker_test_manifest
}
android_resources("linker_resources") {
testonly = true
resource_dirs = [ "linker_test_apk/res" ]
android_manifest = chromium_linker_test_manifest
android_manifest_dep = ":chromium_linker_test_manifest"
}
_linker_test_apk_target_name = "chromium_linker_test_apk__apk"
_linker_test_apk_test_runner_target_name =
"chromium_linker_test_apk__test_runner_script"
_linker_test_jni_registration_header =
"$target_gen_dir/linker_test_apk/linker_test_jni_registration.h"
android_apk(_linker_test_apk_target_name) {
testonly = true
deps = [
":content_shell_assets",
":content_shell_java",
":linker_resources",
"//base:base_java",
"//content/public/android:content_java",
"//ui/android:ui_java",
]
android_manifest = chromium_linker_test_manifest
android_manifest_dep = ":chromium_linker_test_manifest"
apk_name = "ChromiumLinkerTest"
java_files = [
"linker_test_apk/src/org/chromium/chromium_linker_test_apk/ChromiumLinkerTestActivity.java",
"linker_test_apk/src/org/chromium/chromium_linker_test_apk/ChromiumLinkerTestApplication.java",
"linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java",
]
shared_libraries = [ ":linker_test" ]
use_chromium_linker = true
enable_chromium_linker_tests = true
jni_registration_header = _linker_test_jni_registration_header
}
test_runner_script(_linker_test_apk_test_runner_target_name) {
test_name = "chromium_linker_test_apk"
test_type = "linker"
apk_target = ":$_linker_test_apk_target_name"
ignore_all_data_deps = true
}
group("chromium_linker_test_apk") {
testonly = true
deps = [
":$_linker_test_apk_target_name",
":$_linker_test_apk_test_runner_target_name",
]
}
shared_library("linker_test") {
testonly = true
sources = [
"linker_test_apk/chromium_linker_test_android.cc",
"linker_test_apk/chromium_linker_test_linker_tests.cc",
_linker_test_jni_registration_header,
]
deps = [
":${_linker_test_apk_target_name}__final_jni",
":linker_test_jni_headers",
"//content/shell:content_shell_lib",
# Required to include "content/public/browser/android/compositor.h"
# in chromium_linker_test_android.cc :-(
"//skia",
"//third_party/re2",
]
# Explicit dependency required for JNI registration to be able to
# find the native side functions.
if (is_component_build) {
deps += [
"//device/gamepad",
"//media/midi",
]
}
}
generate_jni("linker_test_jni_headers") {
testonly = true
sources = [
"linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java",
]
}
}
android_library("content_shell_browsertests_java") {
testonly = true
deps = [
":content_shell_java",
"//base:base_java",
"//content/public/android:content_java",
"//testing/android/native_test:native_test_java",
"//ui/android:ui_java",
]
java_files = [ "browsertests/src/org/chromium/content_shell/browsertests/ContentShellBrowserTestActivity.java" ]
}