# 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("//base/android/jni_generator/config.gni") 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" content_shell_test_manifest = "$target_gen_dir/content_shell_test_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_app", "//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", "//base:base_javatests_lib", "//content/public/test/android:content_native_test_support", "//content/shell:content_shell_app", "//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 sources = [ "java/res/drawable/ic_refresh.png", "java/res/drawable/progress.xml", "java/res/layout/shell_view.xml", "java/res/mipmap-hdpi/app_icon.png", "java/res/mipmap-mdpi/app_icon.png", "java/res/mipmap-xhdpi/app_icon.png", "java/res/mipmap-xxhdpi/app_icon.png", "java/res/mipmap-xxxhdpi/app_icon.png", "java/res/values/strings.xml", ] } android_library("content_shell_java") { testonly = true resources_package = "org.chromium.content_shell" deps = [ ":content_shell_java_resources", ":content_shell_manifest", "//base:base_java", "//base:jni_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", "//ui/base/cursor/mojom:cursor_type_java", ] sources = [ "java/src/org/chromium/content_shell/Shell.java", "java/src/org/chromium/content_shell/ShellManager.java", "java/src/org/chromium/content_shell/ShellViewAndroidDelegate.java", ] annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] } jinja_template("content_shell_manifest") { testonly = true input = "shell_apk/AndroidManifest.xml.jinja2" output = content_shell_manifest variables = [ "manifest_package=org.chromium.content_shell_apk" ] } jinja_template("content_shell_test_manifest") { testonly = true input = "javatests/AndroidManifest.xml" includes = [ "shell_apk/AndroidManifest.xml.jinja2" ] output = content_shell_test_manifest variables = [ "manifest_package=org.chromium.content_shell_apk.tests" ] } android_resources("content_shell_apk_resources") { testonly = true sources = [ "shell_apk/res/layout/content_shell_activity.xml", "shell_apk/res/values/strings.xml", ] deps = [ ":content_shell_java_resources" ] } android_library("content_shell_apk_java") { testonly = true srcjar_deps = [ ":content_javatests_aidl" ] resources_package = "org.chromium.content_shell_apk" 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/android_deps:com_google_code_findbugs_jsr305_java", "//ui/android:ui_java", ] sources = [ "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" ] } } template("content_shell_apk_tmpl") { _target_type = invoker.target_type target(_target_type, target_name) { forward_variables_from(invoker, "*") testonly = true if (!defined(deps)) { deps = [] } 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/core/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", ] loadable_modules = [ "$root_out_dir/libchrome_crashpad_handler.so" ] } } content_shell_apk_tmpl("content_shell_apk") { target_type = "android_apk" apk_name = "ContentShell" android_manifest = content_shell_manifest android_manifest_dep = ":content_shell_manifest" shared_libraries = [ ":libcontent_shell_content_view" ] command_line_flags_file = "content-shell-command-line" } content_shell_apk_tmpl("content_shell_test_apk") { target_type = "instrumentation_test_apk" apk_name = "ContentShellTest" android_manifest = content_shell_test_manifest android_manifest_dep = ":content_shell_test_manifest" shared_libraries = [ ":libcontent_native_test" ] 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", ] data_deps = [ "//testing/buildbot/filters:content_shell_test_apk_filters" ] if (enable_chrome_android_internal) { data_deps += [ "//clank/build/bot/filters:content_shell_test_apk_filters" ] } # TODO(crbug.com/1099536): Fix tests that break when this is increased. target_sdk_version = 24 } 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_deps:androidx_test_runner_java", "//third_party/android_support_test_runner:rules_java", "//third_party/android_support_test_runner:runner_java", "//third_party/hamcrest:hamcrest_java", "//third_party/junit:junit", "//ui/android:ui_java", ] sources = [ "javatests/src/org/chromium/content_shell_apk/ContentShellActivityTestRule.java", "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/ContentShellUrlTest.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", "//third_party/android_deps:androidx_core_core_java", "//ui/android:ui_java", ] sources = [ "browsertests/src/org/chromium/content_shell/browsertests/ContentShellBrowserTestActivity.java" ] }