Android: Create robolectric_library template for on host tests
- robolectric_library allows deps on android_library targets. - Creates an robolectric test sdk target (that still has the @hide methods and constants that were removed from the normal sdk). - robolectric_library and junit_binary now compile against the new robolectric test sdk. - Robolectric targets now compile against the android 12 robolectric test sdk (previously android 10). Bug: 1296632 Change-Id: I0782443a12cf2d4a8bf5bc3b8424a47400a83120 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3696549 Auto-Submit: Mohamed Heikal <mheikal@chromium.org> Owners-Override: Andrew Grieve <agrieve@chromium.org> Reviewed-by: Andrew Grieve <agrieve@chromium.org> Commit-Queue: Mohamed Heikal <mheikal@chromium.org> Cr-Commit-Position: refs/heads/main@{#1013712}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
ba4739731a
commit
1b83653b29
base
build
android
config
android
chrome
android
browser
android
back_press
android
bluetooth
android
browser_controls
android
commerce
merchant_viewer
android
continuous_search
device
download
enterprise
util
feed
android
flags
incognito
loading_modal
android
notifications
page_annotations
test
android
partnerbookmarks
password_edit_dialog
android
password_entry_edit
android
internal
payments
android
policy
android
preferences
safety_check
android
signin
services
android
tab
tab_group
tabmodel
tabpersistence
ui
android
appmenu
internal
autofill
internal
default_browser_promo
layouts
logo
multiwindow
native_page
night_mode
omnibox
signin
toolbar
webid
internal
messages
android
usb
android
util
video_tutorials
internal
components
android_autofill
browser
junit
background_task_scheduler
browser_ui
accessibility
android
bottomsheet
android
internal
client_certificate
android
media
android
photo_picker
android
util
android
webshare
android
widget
android
content_capture
android
junit
crash
android
download
network
embedder_support
android
externalauth
android
gcm_driver
android
image_fetcher
installedapp
android
language
android
media_router
browser
android
messages
payments
content
android
permissions
android
policy
android
prefs
android
query_tiles
signin
public
android
subresource_filter
android
variations
android
webapk
android
libs
client
webapps
browser
android
content/public/android
testing/android/junit
third_party
ui/android
url
weblayer/browser/java
@ -4383,9 +4383,7 @@ if (is_android) {
|
||||
sources = [ "test/android/javatests/src/org/chromium/base/process_launcher/TestChildProcessConnection.java" ]
|
||||
}
|
||||
|
||||
android_library("base_junit_test_support") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("base_junit_test_support") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"//third_party/robolectric/custom_asynctask/java/src/org/chromium/base/task/test/ShadowAsyncTask.java",
|
||||
@ -4406,7 +4404,6 @@ if (is_android) {
|
||||
deps = [
|
||||
":base_java",
|
||||
"//testing/android/junit:junit_test_support",
|
||||
"//third_party/android_deps:robolectric_all_java",
|
||||
"//third_party/android_support_test_runner:runner_java",
|
||||
"//third_party/androidx:androidx_test_core_java",
|
||||
"//third_party/hamcrest:hamcrest_java",
|
||||
|
@ -9,8 +9,6 @@ import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.content.ContentProvider;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
@ -468,8 +466,7 @@ public class FileUtilsTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ParcelFileDescriptor openFile(@NonNull Uri uri, @NonNull String mode)
|
||||
throws FileNotFoundException {
|
||||
public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
|
||||
String uriString = uri.toString();
|
||||
if (mUriToFilename.containsKey(uriString)) {
|
||||
String filename = mUriToFilename.get(uriString);
|
||||
|
@ -755,7 +755,7 @@ def main(argv):
|
||||
options.java_version,
|
||||
])
|
||||
if options.java_version == '1.8':
|
||||
# Android's boot jar doesn't contain all java 8 classes.
|
||||
# Android's boot jar doesn't contain all java classes.
|
||||
options.bootclasspath.append(build_utils.RT_JAR_PATH)
|
||||
|
||||
# This effectively disables all annotation processors, even including
|
||||
@ -765,7 +765,12 @@ def main(argv):
|
||||
javac_args.extend(['-proc:none'])
|
||||
|
||||
if options.bootclasspath:
|
||||
javac_args.extend(['-bootclasspath', ':'.join(options.bootclasspath)])
|
||||
# if we are targeting source code higher than java 8, we cannot use
|
||||
# -bootclasspath anymore (deprecated). Instead just prepend the classpath.
|
||||
if options.java_version != '1.8':
|
||||
options.classpath = options.bootclasspath + options.classpath
|
||||
else:
|
||||
javac_args.extend(['-bootclasspath', ':'.join(options.bootclasspath)])
|
||||
|
||||
if options.processorpath:
|
||||
javac_args.extend(['-processorpath', ':'.join(options.processorpath)])
|
||||
|
@ -409,9 +409,15 @@ def _FixManifest(options, temp_dir, extra_manifest=None):
|
||||
except build_utils.CalledProcessError:
|
||||
return None
|
||||
|
||||
android_sdk_jars = [j for j in options.include_resources
|
||||
if os.path.basename(j) in ('android.jar',
|
||||
'android_system.jar')]
|
||||
def is_sdk_jar(jar_name):
|
||||
if jar_name in ('android.jar', 'android_system.jar'):
|
||||
return True
|
||||
# Robolectric jar looks a bit different.
|
||||
return 'android-all' in jar_name and 'robolectric' in jar_name
|
||||
|
||||
android_sdk_jars = [
|
||||
j for j in options.include_resources if is_sdk_jar(os.path.basename(j))
|
||||
]
|
||||
extract_all = [maybe_extract_version(j) for j in android_sdk_jars]
|
||||
successful_extractions = [x for x in extract_all if x]
|
||||
if len(successful_extractions) == 0:
|
||||
|
@ -101,7 +101,7 @@ def main(argv):
|
||||
options.java_version,
|
||||
])
|
||||
if options.java_version == '1.8':
|
||||
# Android's boot jar doesn't contain all java 8 classes.
|
||||
# Android's boot jar doesn't contain all java classes.
|
||||
options.bootclasspath.append(build_utils.RT_JAR_PATH)
|
||||
|
||||
if options.bootclasspath:
|
||||
|
@ -1057,6 +1057,11 @@ def main(argv):
|
||||
action='store_true',
|
||||
help='True if a java library is not chromium code, used for lint.')
|
||||
|
||||
# robolectric_library options
|
||||
parser.add_option('--is-robolectric',
|
||||
action='store_true',
|
||||
help='Whether this is a host side android test library.')
|
||||
|
||||
# android library options
|
||||
parser.add_option('--dex-path', help='Path to target\'s dex output.')
|
||||
|
||||
@ -1442,7 +1447,10 @@ def main(argv):
|
||||
deps_info['requires_android'] = bool(options.requires_android)
|
||||
deps_info['supports_android'] = bool(options.supports_android)
|
||||
|
||||
if not options.bypass_platform_checks:
|
||||
# robolectric is special in that its an android target that runs on host.
|
||||
# You are allowed to depend on both android |deps_require_android| and
|
||||
# non-android |deps_not_support_android| targets.
|
||||
if not options.bypass_platform_checks and not options.is_robolectric:
|
||||
deps_require_android = (all_resources_deps +
|
||||
[d['name'] for d in all_library_deps if d['requires_android']])
|
||||
deps_not_support_android = (
|
||||
@ -1517,7 +1525,8 @@ def main(argv):
|
||||
if options.res_sources_path:
|
||||
deps_info['res_sources_path'] = options.res_sources_path
|
||||
|
||||
if options.requires_android and options.type == 'java_library':
|
||||
if (options.requires_android
|
||||
and options.type == 'java_library') or options.is_robolectric:
|
||||
if options.package_name:
|
||||
deps_info['package_name'] = options.package_name
|
||||
|
||||
|
@ -85,6 +85,8 @@ _custom_d8_path = "//third_party/r8/custom_d8.jar"
|
||||
_desugar_jdk_libs_json = "//third_party/r8/desugar_jdk_libs.json"
|
||||
_desugar_jdk_libs_jar = "//third_party/android_deps/libs/com_android_tools_desugar_jdk_libs/desugar_jdk_libs-1.1.5.jar"
|
||||
_desugar_jdk_libs_configuration_jar = "//third_party/android_deps/libs/com_android_tools_desugar_jdk_libs_configuration/desugar_jdk_libs_configuration-1.1.5.jar"
|
||||
_robolectric_jar_path =
|
||||
"//third_party/robolectric/lib/android-all-12-robolectric-7732740.jar"
|
||||
|
||||
# Put the bug number in the target name so that false-positives have a hint in
|
||||
# the error message about why non-existent dependencies are there.
|
||||
@ -288,6 +290,9 @@ template("write_build_config") {
|
||||
invoker.bypass_platform_checks) {
|
||||
args += [ "--bypass-platform-checks" ]
|
||||
}
|
||||
if (defined(invoker.is_robolectric) && invoker.is_robolectric) {
|
||||
args += [ "--is-robolectric" ]
|
||||
}
|
||||
|
||||
if (defined(invoker.apk_under_test)) {
|
||||
deps += [ "${invoker.apk_under_test}$build_config_target_suffix" ]
|
||||
@ -1404,6 +1409,11 @@ if (enable_java_templates) {
|
||||
invoker.tiered_stop_at_level_one) {
|
||||
args += [ "--tiered-stop-at-level-one" ]
|
||||
}
|
||||
if (defined(invoker.extra_classpath_jars)) {
|
||||
_rebased_extra_classpath_jars =
|
||||
rebase_path(invoker.extra_classpath_jars, root_build_dir)
|
||||
args += [ "--classpath=${_rebased_extra_classpath_jars}" ]
|
||||
}
|
||||
if (defined(invoker.wrapper_script_args)) {
|
||||
args += [ "--" ] + invoker.wrapper_script_args
|
||||
}
|
||||
@ -1884,7 +1894,7 @@ if (enable_java_templates) {
|
||||
if (android_static_analysis == "build_server") {
|
||||
args += [ "--use-build-server" ]
|
||||
}
|
||||
if (invoker.requires_android) {
|
||||
if (invoker.include_android_sdk) {
|
||||
args += [ "--sdk-classpath-jars=@FileArg($_rebased_build_config:android:sdk_jars)" ]
|
||||
}
|
||||
if (invoker.is_prebuilt) {
|
||||
@ -3022,7 +3032,6 @@ if (enable_java_templates) {
|
||||
]
|
||||
}
|
||||
|
||||
# Currently turbine does not support JDK11.
|
||||
if (invoker.supports_android || invoker.use_turbine) {
|
||||
args += [ "--java-version=1.8" ]
|
||||
}
|
||||
@ -3038,7 +3047,7 @@ if (enable_java_templates) {
|
||||
if (enable_kythe_annotations && !invoker.enable_errorprone) {
|
||||
args += [ "--enable-kythe-annotations" ]
|
||||
}
|
||||
if (invoker.requires_android) {
|
||||
if (invoker.include_android_sdk) {
|
||||
args += [ "--bootclasspath=@FileArg($_rebased_build_config:android:sdk_interface_jars)" ]
|
||||
}
|
||||
if (_chromium_code) {
|
||||
@ -3219,11 +3228,8 @@ if (enable_java_templates) {
|
||||
# library via its built .jar rather than including its .java sources.
|
||||
# proguard_enabled: Optional. True to enable ProGuard obfuscation.
|
||||
# proguard_configs: Optional list of additional proguard config file paths.
|
||||
# bypass_platform_checks: Optional. If True, platform checks will not
|
||||
# be performed. They are used to verify that every target with
|
||||
# requires_android only depends on targets that, at least supports_android.
|
||||
# Similarly, if a target has !supports_android, then it cannot depend on
|
||||
# any other target that has requires_android.
|
||||
# is_robolectric: Optional. If True, this is a host side android test binary
|
||||
# which is allowed to depend on other android targets.
|
||||
# include_java_resources: Optional. If True, include Java (not Android)
|
||||
# resources into final .jar file.
|
||||
# jar_excluded_patterns: Optional list of .class file patterns to exclude
|
||||
@ -3294,6 +3300,7 @@ if (enable_java_templates) {
|
||||
defined(invoker.requires_android) && invoker.requires_android
|
||||
_bypass_platform_checks = defined(invoker.bypass_platform_checks) &&
|
||||
invoker.bypass_platform_checks
|
||||
_is_robolectric = defined(invoker.is_robolectric) && invoker.is_robolectric
|
||||
|
||||
_invoker_deps = []
|
||||
if (defined(invoker.deps)) {
|
||||
@ -3595,6 +3602,7 @@ if (enable_java_templates) {
|
||||
|
||||
supports_android = _supports_android
|
||||
requires_android = _requires_android
|
||||
is_robolectric = _is_robolectric
|
||||
bypass_platform_checks = _bypass_platform_checks
|
||||
|
||||
if (defined(invoker.resources_package)) {
|
||||
@ -3649,10 +3657,12 @@ if (enable_java_templates) {
|
||||
}
|
||||
|
||||
if (defined(invoker.resources_package) && _type == "java_library") {
|
||||
assert(_requires_android || _bypass_platform_checks,
|
||||
# TODO(crbug.com/1296632): remove _bypass_platform_checks from the list
|
||||
# once all robolectric targets have migrated to robolectric_library.
|
||||
assert(_requires_android || _bypass_platform_checks || _is_robolectric,
|
||||
"Setting resources_package applicable only for " +
|
||||
"android_library(), or java_library() with " +
|
||||
"bypass_platform_checks=true. Target=$target_name")
|
||||
"android_library(), or robolectric_library(). " +
|
||||
"Target=$target_name")
|
||||
|
||||
# has _resources at the end so it looks like a resources pattern, since
|
||||
# it does act like one (and other resources patterns need to depend on
|
||||
@ -3707,7 +3717,7 @@ if (enable_java_templates) {
|
||||
}
|
||||
chromium_code = _chromium_code
|
||||
supports_android = _supports_android
|
||||
requires_android = _requires_android
|
||||
include_android_sdk = _is_robolectric || _requires_android
|
||||
if (!defined(deps)) {
|
||||
deps = []
|
||||
}
|
||||
@ -3841,7 +3851,8 @@ if (enable_java_templates) {
|
||||
forward_variables_from(invoker, [ "missing_classes_allowlist" ])
|
||||
deps = _unprocessed_jar_deps + _full_classpath_deps +
|
||||
[ ":$_build_config_target_name" ]
|
||||
requires_android = _requires_android
|
||||
|
||||
include_android_sdk = _requires_android || _is_robolectric
|
||||
target_label =
|
||||
get_label_info(":${invoker.target_name}", "label_no_toolchain")
|
||||
input_jar = _unprocessed_jar_path
|
||||
@ -3952,6 +3963,9 @@ if (enable_java_templates) {
|
||||
script_name = invoker.wrapper_script_name
|
||||
}
|
||||
deps = [ ":$_build_config_target_name" ]
|
||||
if (_is_robolectric) {
|
||||
extra_classpath_jars = [ _robolectric_jar_path ]
|
||||
}
|
||||
}
|
||||
_public_deps += [ ":$_java_binary_script_target_name" ]
|
||||
}
|
||||
|
@ -1456,12 +1456,6 @@ if (enable_java_templates) {
|
||||
type = "junit_binary"
|
||||
main_target_name = invoker.target_name
|
||||
|
||||
# Include the android SDK jar(s) for resource processing.
|
||||
include_android_sdk = true
|
||||
|
||||
# Robolectric can handle deps that set !supports_android as well those
|
||||
# that set requires_android.
|
||||
bypass_platform_checks = true
|
||||
deps = _invoker_deps
|
||||
testonly = true
|
||||
main_class = _main_class
|
||||
@ -1472,6 +1466,11 @@ if (enable_java_templates) {
|
||||
# 66%, which makes sharding more effective.
|
||||
tiered_stop_at_level_one = true
|
||||
|
||||
is_robolectric = true
|
||||
include_android_sdk = true
|
||||
alternative_android_sdk_dep =
|
||||
"//third_party/robolectric:robolectric_test_sdk_java"
|
||||
|
||||
if (!defined(srcjar_deps)) {
|
||||
srcjar_deps = []
|
||||
}
|
||||
@ -1995,6 +1994,70 @@ if (enable_java_templates) {
|
||||
}
|
||||
}
|
||||
|
||||
# Declare an Android robolectric library target
|
||||
#
|
||||
# This target creates an Android library containing java code and Android
|
||||
# resources.
|
||||
#
|
||||
# Supports all variables of java_library(), plus:
|
||||
# deps: In addition to defining java deps, this can also include
|
||||
# android_assets() and android_resources() targets.
|
||||
# alternative_android_sdk_ijar: if set, the given android_sdk_ijar file
|
||||
# replaces the default android_sdk_ijar.
|
||||
# alternative_android_sdk_ijar_dep: the target that generates
|
||||
# alternative_android_sdk_ijar, must be set if alternative_android_sdk_ijar
|
||||
# is used.
|
||||
# alternative_android_sdk_jar: actual jar corresponding to
|
||||
# alternative_android_sdk_ijar, must be set if alternative_android_sdk_ijar
|
||||
# is used.
|
||||
#
|
||||
# Example
|
||||
# robolectric_library("foo_junit") {
|
||||
# sources = [
|
||||
# "android/org/chromium/foo/FooTest.java",
|
||||
# "android/org/chromium/foo/FooTestUtils.java",
|
||||
# "android/org/chromium/foo/FooMock.java",
|
||||
# ]
|
||||
# deps = [
|
||||
# "//base:base_junit_test_support"
|
||||
# ]
|
||||
# srcjar_deps = [
|
||||
# ":foo_generated_enum"
|
||||
# ]
|
||||
# jar_excluded_patterns = [
|
||||
# "*/FooService.class", "org/chromium/FooService\$*.class"
|
||||
# ]
|
||||
# }
|
||||
template("robolectric_library") {
|
||||
java_library(target_name) {
|
||||
forward_variables_from(invoker, "*", TESTONLY_AND_VISIBILITY)
|
||||
forward_variables_from(invoker, TESTONLY_AND_VISIBILITY)
|
||||
|
||||
testonly = true
|
||||
|
||||
is_robolectric = true
|
||||
include_android_sdk = true
|
||||
alternative_android_sdk_dep =
|
||||
"//third_party/robolectric:robolectric_test_sdk_java"
|
||||
|
||||
if (!defined(jar_excluded_patterns)) {
|
||||
jar_excluded_patterns = []
|
||||
}
|
||||
jar_excluded_patterns += [
|
||||
"*/R.class",
|
||||
"*/R\$*.class",
|
||||
"*/Manifest.class",
|
||||
"*/Manifest\$*.class",
|
||||
"*/GEN_JNI.class",
|
||||
]
|
||||
|
||||
if (!defined(deps)) {
|
||||
deps = []
|
||||
}
|
||||
deps += [ "//third_party/android_deps:robolectric_all_java" ]
|
||||
}
|
||||
}
|
||||
|
||||
# Declare an Android library target for a prebuilt jar
|
||||
#
|
||||
# This target creates an Android library containing java code and Android
|
||||
|
@ -92,8 +92,7 @@ generate_dummy_android_library("a2_master_java") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit_tests") {
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit_tests") {
|
||||
testonly = true
|
||||
sources =
|
||||
[ "java/src/org/chromium/build/classpath_order/ClassPathOrderTest.java" ]
|
||||
|
@ -69,8 +69,7 @@ android_library_factory("a_factory2_java") {
|
||||
generator_deps = [ ":factory2" ]
|
||||
}
|
||||
|
||||
java_library("junit_tests") {
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit_tests") {
|
||||
testonly = true
|
||||
sources = [ "junit/src/org/chromium/chrome/browser/android_library_factory/AndroidLibraryFactoryTest.java" ]
|
||||
deps = [
|
||||
|
@ -4,9 +4,7 @@
|
||||
|
||||
import("//build/config/android/rules.gni")
|
||||
|
||||
java_library("junit_test_support") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit_test_support") {
|
||||
testonly = true
|
||||
sources = [ "src/org/chromium/webapk/test/WebApkTestHelper.java" ]
|
||||
deps = [
|
||||
|
@ -33,9 +33,7 @@ android_library("java") {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"java/src/org/chromium/chrome/browser/browserservices/intents/WebApkInfoTest.java",
|
||||
|
@ -40,8 +40,8 @@ generate_jni("jni_headers") {
|
||||
android_library("javatests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"./java/src/org/chromium/chrome/browser/browserservices/verification/OriginVerifierTest.java",
|
||||
"./java/src/org/chromium/chrome/browser/browserservices/verification/PackageFingerprintCalculatorTest.java",
|
||||
"java/src/org/chromium/chrome/browser/browserservices/verification/OriginVerifierTest.java",
|
||||
"java/src/org/chromium/chrome/browser/browserservices/verification/PackageFingerprintCalculatorTest.java",
|
||||
]
|
||||
|
||||
deps = [
|
||||
@ -60,11 +60,9 @@ android_library("javatests") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit_test_support") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit_test_support") {
|
||||
testonly = true
|
||||
sources = [ "./java/src/org/chromium/chrome/browser/browserservices/verification/OriginVerifierUnitTestSupport.java" ]
|
||||
sources = [ "java/src/org/chromium/chrome/browser/browserservices/verification/OriginVerifierUnitTestSupport.java" ]
|
||||
deps = [
|
||||
":java",
|
||||
"//components/embedder_support/android:util_java",
|
||||
|
@ -69,9 +69,7 @@ android_resources("java_resources") {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("junit_tests") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit_tests") {
|
||||
testonly = true
|
||||
|
||||
sources = [
|
||||
|
@ -23,12 +23,9 @@ android_library("java") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
|
||||
sources = [ "java/src/org/chromium/chrome/browser/back_press/BackPressManagerUnitTest.java" ]
|
||||
|
||||
deps = [
|
||||
|
@ -42,12 +42,9 @@ generate_jni("jni_headers") {
|
||||
[ "java/src/org/chromium/chrome/browser/bluetooth/BluetoothBridge.java" ]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
|
||||
sources = [ "junit/src/org/chromium/chrome/browser/bluetooth/BluetoothNotificationManagerTest.java" ]
|
||||
|
||||
deps = [
|
||||
|
@ -25,9 +25,7 @@ android_library("java") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [ "java/src/org/chromium/chrome/browser/browser_controls/BrowserStateBrowserControlsVisibilityDelegateTest.java" ]
|
||||
deps = [
|
||||
|
@ -82,10 +82,7 @@ android_library("java") {
|
||||
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
sources = [
|
||||
@ -136,7 +133,6 @@ java_library("junit") {
|
||||
"//content/public/android:content_java",
|
||||
"//content/public/test/android:content_java_test_support",
|
||||
"//third_party/android_deps:protobuf_lite_runtime_java",
|
||||
"//third_party/android_deps:robolectric_all_java",
|
||||
"//third_party/androidx:androidx_test_runner_java",
|
||||
"//third_party/hamcrest:hamcrest_core_java",
|
||||
"//third_party/junit",
|
||||
|
@ -156,8 +156,7 @@ if (is_android) {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
sources = [
|
||||
|
@ -46,8 +46,7 @@ android_library("java") {
|
||||
resources_package = "org.chromium.chrome.browser.continuous_search"
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
sources = [
|
||||
|
@ -20,9 +20,7 @@ android_library("java") {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"android/java/src/org/chromium/chrome/browser/device/DeviceConditionsTest.java",
|
||||
|
@ -189,9 +189,7 @@ android_library("download_java_tests") {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("junit_tests") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit_tests") {
|
||||
testonly = true
|
||||
|
||||
sources = [
|
||||
|
@ -267,9 +267,7 @@ android_library("javatests") {
|
||||
resources_package = "org.chromium.chrome.browser.download.internal"
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"java/src/org/chromium/chrome/browser/download/home/filter/DeleteUndoOfflineItemFilterTest.java",
|
||||
|
@ -28,9 +28,7 @@ generate_jni("jni_headers") {
|
||||
sources = _jni_sources
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
sources = [ "android/java/src/org/chromium/chrome/browser/enterprise/util/EnterpriseInfoImplTest.java" ]
|
||||
|
@ -275,12 +275,9 @@ android_library("javatests") {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
|
||||
sources = [
|
||||
"java/src/org/chromium/chrome/browser/feed/FakeLinearLayoutManager.java",
|
||||
"java/src/org/chromium/chrome/browser/feed/FeedFeaturesTest.java",
|
||||
|
@ -70,9 +70,7 @@ java_cpp_enum("chrome_browser_flags_enums_srcjar") {
|
||||
sources = [ "android/chrome_session_state.h" ]
|
||||
}
|
||||
|
||||
java_library("flags_junit_tests") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("flags_junit_tests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlagsAnnotationUnitTest.java",
|
||||
|
@ -106,12 +106,9 @@ android_library("incognito_java_tests") {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("incognito_junit_tests") {
|
||||
robolectric_library("incognito_junit_tests") {
|
||||
testonly = true
|
||||
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
|
||||
sources = [
|
||||
"android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthControllerTest.java",
|
||||
"android/java/src/org/chromium/chrome/browser/incognito/reauth/IncognitoReauthManagerTest.java",
|
||||
|
@ -31,9 +31,7 @@ android_resources("java_resources") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
sources = [ "junit/src/org/chromium/chrome/browser/loading_modal/LoadingModalDialogMediatorTest.java" ]
|
||||
|
@ -99,9 +99,7 @@ if (is_android) {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("junit_tests") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit_tests") {
|
||||
testonly = true
|
||||
|
||||
sources = [
|
||||
|
@ -5,10 +5,7 @@
|
||||
import("//build/config/android/config.gni")
|
||||
import("//build/config/android/rules.gni")
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
sources = [
|
||||
|
@ -13,7 +13,7 @@ import org.robolectric.annotation.Config;
|
||||
import org.chromium.base.test.BaseRobolectricTestRunner;
|
||||
import org.chromium.chrome.browser.page_annotations.PageAnnotation.PageAnnotationType;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -22,9 +22,8 @@ import java.util.List;
|
||||
@RunWith(BaseRobolectricTestRunner.class)
|
||||
@Config(manifest = Config.NONE)
|
||||
public class PageAnnotationUtilsUnitTest {
|
||||
private static final List<PageAnnotation> DUMMY_ANNOTATIONS_LIST = new LinkedList<>() {
|
||||
{ add(new BuyableProductPageAnnotation(100L, "USD", "200")); }
|
||||
};
|
||||
private static final List<PageAnnotation> DUMMY_ANNOTATIONS_LIST = Arrays.asList(
|
||||
new PageAnnotation[] {new BuyableProductPageAnnotation(100L, "USD", "200")});
|
||||
|
||||
private static class DummyPageAnnotation extends PageAnnotation {
|
||||
DummyPageAnnotation() {
|
||||
@ -67,4 +66,4 @@ public class PageAnnotationUtilsUnitTest {
|
||||
DUMMY_ANNOTATIONS_LIST, DummyPageAnnotation.class);
|
||||
Assert.assertNull(annotation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -49,12 +49,9 @@ generate_jni("jni_headers") {
|
||||
sources = [ "java/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksReader.java" ]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
|
||||
sources = [
|
||||
"junit/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksFaviconThrottleTest.java",
|
||||
"junit/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksReaderTest.java",
|
||||
|
@ -68,9 +68,7 @@ android_resources("java_resources") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [ "java/src/org/chromium/chrome/browser/password_edit_dialog/PasswordEditDialogTest.java" ]
|
||||
|
||||
|
@ -38,9 +38,7 @@ android_library("java") {
|
||||
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [ "java/src/org/chromium/chrome/browser/password_entry_edit/CredentialEditControllerTest.java" ]
|
||||
|
||||
|
@ -13,9 +13,7 @@ generate_jni("jni_headers") {
|
||||
}
|
||||
|
||||
# TODO(crbug.com/1164979): remove the dependency on chrome_java.
|
||||
android_library("junit_test_support") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit_test_support") {
|
||||
testonly = true
|
||||
deps = [
|
||||
"//chrome/android:chrome_java",
|
||||
@ -46,9 +44,7 @@ android_library("junit_test_support") {
|
||||
}
|
||||
|
||||
# TODO(crbug.com/1164979): remove the dependency on chrome_java.
|
||||
java_library("junit") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
deps = [
|
||||
":junit_test_support",
|
||||
|
@ -67,9 +67,7 @@ generate_jni("jni_headers") {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
sources = [
|
||||
|
@ -53,9 +53,7 @@ generate_jni("jni_headers") {
|
||||
sources = [ "android/java/src/org/chromium/chrome/browser/preferences/PrefChangeRegistrar.java" ]
|
||||
}
|
||||
|
||||
java_library("preferences_junit_tests") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("preferences_junit_tests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeyCheckerTest.java",
|
||||
|
@ -93,9 +93,7 @@ android_library("javatests") {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [ "javatests/src/org/chromium/chrome/browser/safety_check/SafetyCheckMediatorTest.java" ]
|
||||
deps = [
|
||||
|
@ -81,9 +81,7 @@ android_library("javatests") {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"junit/src/org/chromium/chrome/browser/signin/services/ProfileDataCacheUnitTest.java",
|
||||
|
@ -145,8 +145,7 @@ flatbuffer_java_library("critical_persisted_tab_data_flatbuffer_java") {
|
||||
sources = [ "$root_dir/critical_persisted_tab_data.fbs" ]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"java/src/org/chromium/chrome/browser/tab/CurrentTabObserverTest.java",
|
||||
|
@ -21,9 +21,7 @@ android_library("java") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
sources = [
|
||||
|
@ -66,9 +66,7 @@ android_library_factory("factory_java") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
sources = [ "android/java/src/org/chromium/chrome/browser/tabmodel/TabWindowManagerTest.java" ]
|
||||
|
@ -20,9 +20,7 @@ android_library("java") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [ "android/java/src/org/chromium/chrome/browser/tabpersistence/TabStateFileManagerUnitTest.java" ]
|
||||
deps = [
|
||||
|
@ -114,9 +114,7 @@ android_resources("test_java_resources") {
|
||||
deps = [ ":java_resources" ]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [ "java/src/org/chromium/chrome/browser/ui/appmenu/AppMenuPopupPositionTest.java" ]
|
||||
deps = [
|
||||
|
@ -53,9 +53,7 @@ generate_jni("jni_headers") {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"java/src/org/chromium/chrome/browser/ui/autofill/AuthenticatorSelectionDialogBridgeTest.java",
|
||||
|
@ -22,9 +22,7 @@ android_library("java") {
|
||||
resources_package = "org.chromium.chrome.browser.ui.default_browser_promo"
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [ "java/src/org/chromium/chrome/browser/ui/default_browser_promo/DefaultBrowserPromoUtilsTest.java" ]
|
||||
deps = [
|
||||
|
@ -52,9 +52,7 @@ generate_jni("layouts_jni_headers") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
sources = [
|
||||
|
@ -74,9 +74,7 @@ android_library("javatests") {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
sources = [
|
||||
|
@ -67,11 +67,7 @@ android_resources("java_resources") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
testonly = true
|
||||
|
||||
robolectric_library("junit") {
|
||||
sources = [
|
||||
"java/src/org/chromium/chrome/browser/multiwindow/MultiInstanceStateUnitTest.java",
|
||||
"java/src/org/chromium/chrome/browser/multiwindow/UiUtilsUnitTest.java",
|
||||
@ -85,7 +81,6 @@ java_library("junit") {
|
||||
"//chrome/browser/profiles/android:java",
|
||||
"//chrome/browser/util:java",
|
||||
"//components/favicon/android:java",
|
||||
"//third_party/android_deps:robolectric_all_java",
|
||||
"//third_party/android_support_test_runner:runner_java",
|
||||
"//third_party/androidx:androidx_test_core_java",
|
||||
"//third_party/androidx:androidx_test_runner_java",
|
||||
|
@ -66,6 +66,7 @@ public class MultiInstanceStateUnitTest {
|
||||
ApplicationStatus.onStateChangeForTesting(this, ActivityState.STOPPED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
AppTask appTask = null;
|
||||
for (AppTask task : sTasks.keySet()) {
|
||||
@ -125,7 +126,7 @@ public class MultiInstanceStateUnitTest {
|
||||
RecentTaskInfo taskInfo = new RecentTaskInfo();
|
||||
taskInfo.id = taskId;
|
||||
taskInfo.baseActivity = new ComponentName(
|
||||
activity.getClass().getPackageName(), activity.getClass().getName());
|
||||
activity.getClass().getPackage().getName(), activity.getClass().getName());
|
||||
sTasks.put(new AppTask(null), taskInfo);
|
||||
ApplicationStatus.onStateChangeForTesting(activity, ActivityState.CREATED);
|
||||
ApplicationStatus.onStateChangeForTesting(activity, ActivityState.RESUMED);
|
||||
|
@ -21,9 +21,7 @@ android_library("java") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
sources = [
|
||||
|
@ -104,9 +104,7 @@ android_library("javatests") {
|
||||
resources_package = "org.chromium.chrome.browser.night_mode"
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"java/src/org/chromium/chrome/browser/night_mode/AutoDarkFeedbackSourceUnitTest.java",
|
||||
|
@ -347,9 +347,7 @@ proto_java_library("partner_location_descriptor_proto_java") {
|
||||
sources = [ "$proto_path/partner_location_descriptor.proto" ]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
sources = [
|
||||
|
@ -135,8 +135,7 @@ android_resources("java_resources") {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"junit/src/org/chromium/chrome/browser/ui/signin/ConfirmSyncDataStateMachineTest.java",
|
||||
|
@ -269,9 +269,7 @@ android_resources("java_resources") {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
sources = [
|
||||
|
@ -65,10 +65,7 @@ android_resources("java_resources") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
sources = [ "java/src/org/chromium/chrome/browser/ui/android/webid/AccountSelectionControllerTest.java" ]
|
||||
|
@ -59,10 +59,7 @@ generate_jni("jni_headers") {
|
||||
sources = [ "java/src/org/chromium/chrome/browser/ui/messages/infobar/SimpleConfirmInfoBarBuilder.java" ]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
sources = [ "java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarCollectionUnitTest.java" ]
|
||||
|
@ -41,12 +41,9 @@ generate_jni("jni_headers") {
|
||||
sources = [ "java/src/org/chromium/chrome/browser/usb/UsbBridge.java" ]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
|
||||
sources = [
|
||||
"junit/src/org/chromium/chrome/browser/usb/UsbNotificationManagerTest.java",
|
||||
]
|
||||
|
@ -36,9 +36,7 @@ generate_jni("jni_headers") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit_tests") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit_tests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"android/java/src/org/chromium/chrome/browser/util/ChromeFileProviderTest.java",
|
||||
|
@ -144,9 +144,7 @@ if (is_android) {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"android/java/src/org/chromium/chrome/browser/video_tutorials/PlaybackStateObserverUnitTest.java",
|
||||
|
@ -5,9 +5,7 @@
|
||||
import("//build/config/android/config.gni")
|
||||
import("//build/config/android/rules.gni")
|
||||
|
||||
java_library("components_autofill_junit_tests") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("components_autofill_junit_tests") {
|
||||
testonly = true
|
||||
sources = [ "src/org/chromium/components/autofill/AutofillProviderTest.java" ]
|
||||
deps = [
|
||||
|
@ -99,9 +99,8 @@ if (is_android) {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("components_background_task_scheduler_junit_tests") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("components_background_task_scheduler_junit_tests") {
|
||||
include_android_sdk = false
|
||||
testonly = true
|
||||
sources = [
|
||||
"internal/android/junit/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskGcmTaskServiceTest.java",
|
||||
@ -136,6 +135,7 @@ if (is_android) {
|
||||
"//third_party/android_deps:robolectric_all_java",
|
||||
"//third_party/junit",
|
||||
"//third_party/mockito:mockito_java",
|
||||
"//third_party/robolectric:robolectric_test_sdk_java",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
import android.app.job.JobParameters;
|
||||
import android.os.Build;
|
||||
import android.os.PersistableBundle;
|
||||
|
||||
import org.junit.Before;
|
||||
@ -29,7 +30,7 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
/** Unit tests for {@link BackgroundTaskJobService}. */
|
||||
@RunWith(BaseRobolectricTestRunner.class)
|
||||
@Config(manifest = Config.NONE)
|
||||
@Config(manifest = Config.NONE, sdk = Build.VERSION_CODES.S)
|
||||
public class BackgroundTaskJobServiceTest {
|
||||
private static BackgroundTaskSchedulerJobService.Clock sClock = () -> 1415926535000L;
|
||||
private static BackgroundTaskSchedulerJobService.Clock sZeroClock = () -> 0L;
|
||||
@ -196,8 +197,8 @@ public class BackgroundTaskJobServiceTest {
|
||||
|
||||
return new JobParameters(null /* callback */, taskId, extras, null /* transientExtras */,
|
||||
null /* clipData */, 0 /* clipGrantFlags */, false /* overrideDeadlineExpired */,
|
||||
null /* triggeredContentUris */, null /* triggeredContentAuthorities */,
|
||||
null /* network */);
|
||||
false /* isExpedited */, null /* triggeredContentUris */,
|
||||
null /* triggeredContentAuthorities */, null /* network */);
|
||||
}
|
||||
|
||||
private static JobParameters buildPeriodicJobParameters(
|
||||
@ -221,7 +222,7 @@ public class BackgroundTaskJobServiceTest {
|
||||
|
||||
return new JobParameters(null /* callback */, taskId, extras, null /* transientExtras */,
|
||||
null /* clipData */, 0 /* clipGrantFlags */, false /* overrideDeadlineExpired */,
|
||||
null /* triggeredContentUris */, null /* triggeredContentAuthorities */,
|
||||
null /* network */);
|
||||
false /* isExpedited */, null /* triggeredContentUris */,
|
||||
null /* triggeredContentAuthorities */, null /* network */);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.os.BatteryManager;
|
||||
import android.os.Build;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
@ -26,7 +25,6 @@ import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.ThreadUtils;
|
||||
import org.chromium.base.test.BaseRobolectricTestRunner;
|
||||
import org.chromium.base.test.util.Feature;
|
||||
import org.chromium.base.test.util.MinAndroidSdkLevel;
|
||||
import org.chromium.components.background_task_scheduler.BackgroundTask;
|
||||
import org.chromium.components.background_task_scheduler.BackgroundTaskFactory;
|
||||
import org.chromium.components.background_task_scheduler.TaskIds;
|
||||
@ -150,7 +148,6 @@ public final class BroadcastReceiverRobolectricTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@MinAndroidSdkLevel(Build.VERSION_CODES.M)
|
||||
@Feature({"BackgroundTaskScheduler"})
|
||||
public void withChargingRequired() throws InterruptedException {
|
||||
// Set device in charging mode
|
||||
@ -200,7 +197,6 @@ public final class BroadcastReceiverRobolectricTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@MinAndroidSdkLevel(Build.VERSION_CODES.L)
|
||||
@Feature({"BackgroundTaskScheduler"})
|
||||
public void withAnyNetworkRequired() throws InterruptedException {
|
||||
mShadowConnectivityManager.setDefaultNetworkActive(true);
|
||||
@ -225,7 +221,6 @@ public final class BroadcastReceiverRobolectricTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@MinAndroidSdkLevel(Build.VERSION_CODES.M)
|
||||
@Feature({"BackgroundTaskScheduler"})
|
||||
public void withAnyNetworkRequiredButNoConnectivity() throws InterruptedException {
|
||||
mShadowConnectivityManager.setDefaultNetworkActive(false);
|
||||
|
@ -76,8 +76,7 @@ android_resources("java_resources") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [ "java/src/org/chromium/components/browser_ui/accessibility/PageZoomMediatorUnitTest.java" ]
|
||||
|
||||
|
@ -33,8 +33,7 @@ android_library("java") {
|
||||
resources_package = "org.chromium.components.browser_ui.bottomsheet.internal"
|
||||
}
|
||||
|
||||
android_library("junit_tests") {
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit_tests") {
|
||||
testonly = true
|
||||
sources = [ "java/src/org/chromium/components/browser_ui/bottomsheet/BottomSheetSwipeDetectorTest.java" ]
|
||||
deps = [
|
||||
|
@ -46,9 +46,7 @@ source_set("android") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [ "java/src/org/chromium/components/browser_ui/client_certificate/SSLClientCertificateRequestTest.java" ]
|
||||
deps = [
|
||||
|
@ -75,9 +75,7 @@ android_resources("java_resources") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"java/src/org/chromium/components/browser_ui/media/MediaImageManagerTest.java",
|
||||
|
@ -106,9 +106,7 @@ android_resources("java_resources") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"java/src/org/chromium/components/browser_ui/photo_picker/FileEnumWorkerTaskTest.java",
|
||||
|
@ -47,9 +47,7 @@ static_library("android") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"java/src/org/chromium/components/browser_ui/util/BitmapCacheTest.java",
|
||||
|
@ -24,9 +24,7 @@ android_library("java") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"java/src/org/chromium/components/browser_ui/webshare/ShareServiceImplTest.java",
|
||||
|
@ -378,9 +378,7 @@ android_resources("java_test_resources") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"java/src/org/chromium/components/browser_ui/widget/CompositeTouchDelegateUnitTest.java",
|
||||
|
@ -5,9 +5,7 @@
|
||||
import("//build/config/android/config.gni")
|
||||
import("//build/config/android/rules.gni")
|
||||
|
||||
java_library("components_content_capture_junit_tests") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("components_content_capture_junit_tests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"src/org/chromium/components/content_capture/PlatformAPIWrapperTest.java",
|
||||
|
@ -52,9 +52,7 @@ android_library("javatests") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"junit/src/org/chromium/components/crash/LogcatCrashExtractorTest.java",
|
||||
|
@ -67,7 +67,6 @@ if (is_android) {
|
||||
}
|
||||
|
||||
android_library("javatests") {
|
||||
bypass_platform_checks = true
|
||||
testonly = true
|
||||
|
||||
sources = [ "android/java/src/org/chromium/components/download/NetworkStatusListenerAndroidTest.java" ]
|
||||
|
@ -290,9 +290,7 @@ generate_jni("native_j_unittests_jni_headers") {
|
||||
sources = [ "native_java_unittests/src/org/chromium/components/embedder_support/util/InputStreamUnittest.java" ]
|
||||
}
|
||||
|
||||
android_library("junit_test_support") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit_test_support") {
|
||||
testonly = true
|
||||
sources = [ "junit/src/org/chromium/components/embedder_support/util/ShadowUrlUtilities.java" ]
|
||||
deps = [
|
||||
@ -301,9 +299,7 @@ android_library("junit_test_support") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("components_embedder_support_junit_tests") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("components_embedder_support_junit_tests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"junit/src/org/chromium/components/embedder_support/util/OriginTest.java",
|
||||
|
@ -42,9 +42,7 @@ android_library("java") {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("junit") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
|
||||
deps = [
|
||||
|
@ -28,9 +28,7 @@ android_library("gcm_driver_java") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("components_gcm_driver_junit_tests") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("components_gcm_driver_junit_tests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"junit/src/org/chromium/components/gcm_driver/GCMMessageTest.java",
|
||||
|
@ -50,9 +50,8 @@ source_set("android") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
bypass_platform_checks = true
|
||||
sources = [
|
||||
"android/junit/src/org/chromium/components/image_fetcher/CachedImageFetcherTest.java",
|
||||
"android/junit/src/org/chromium/components/image_fetcher/ImageFetcherBridgeTest.java",
|
||||
|
@ -63,9 +63,7 @@ android_library("javatests") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources =
|
||||
[ "java/src/org/chromium/components/installedapp/PackageHashTest.java" ]
|
||||
|
@ -67,9 +67,7 @@ android_library("ulp_delegate_public_java") {
|
||||
deps = [ ":ulp_delegate_java" ]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [ "java/src/org/chromium/components/language/LanguageProfileControllerUnitTest.java" ]
|
||||
deps = [
|
||||
|
@ -119,9 +119,7 @@ generate_jni("test_jni_headers") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"junit/src/org/chromium/components/media_router/BrowserMediaRouterRouteTest.java",
|
||||
|
@ -128,9 +128,7 @@ static_library("feature_flags") {
|
||||
deps = [ "//base" ]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources =
|
||||
[ "java/src/org/chromium/components/messages/MessageWrapperTest.java" ]
|
||||
|
@ -40,9 +40,7 @@ android_library("java") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"java/src/org/chromium/components/messages/MessageAutoDismissTimerTest.java",
|
||||
|
@ -309,9 +309,7 @@ java_cpp_enum("payments_journey_logger_enum_javagen") {
|
||||
sources = [ "//components/payments/core/journey_logger.h" ]
|
||||
}
|
||||
|
||||
java_library("junit_test_support") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit_test_support") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"junit/src/org/chromium/components/payments/test_support/PaymentRequestServiceBuilder.java",
|
||||
@ -335,9 +333,7 @@ java_library("junit_test_support") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"junit/src/org/chromium/components/payments/PaymentRequestServiceTest.java",
|
||||
|
@ -152,9 +152,7 @@ android_library("core_java") {
|
||||
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
|
||||
}
|
||||
|
||||
android_library("components_permissions_junit_tests") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("components_permissions_junit_tests") {
|
||||
testonly = true
|
||||
sources = [ "junit/src/org/chromium/components/permissions/nfc/NfcSystemLevelPromptTest.java" ]
|
||||
deps = [
|
||||
|
@ -59,9 +59,7 @@ generate_jni("jni_headers") {
|
||||
sources = _jni_sources
|
||||
}
|
||||
|
||||
java_library("components_policy_junit_tests") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("components_policy_junit_tests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"junit/src/org/chromium/components/policy/AbstractAppRestrictionsProviderTest.java",
|
||||
|
@ -18,9 +18,7 @@ android_library("java") {
|
||||
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [ "java/src/org/chromium/components/prefs/PrefServiceTest.java" ]
|
||||
deps = [
|
||||
|
@ -133,8 +133,7 @@ if (is_android) {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("query_tiles_junit_tests") {
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("query_tiles_junit_tests") {
|
||||
testonly = true
|
||||
sources = [ "android/java/src/org/chromium/components/query_tiles/TileUmaLoggerTest.java" ]
|
||||
|
||||
|
@ -148,8 +148,7 @@ android_library("javatests") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"junit/src/org/chromium/components/signin/AccountManagerFacadeImplTest.java",
|
||||
|
@ -34,9 +34,7 @@ android_library("java") {
|
||||
resources_package = "org.chromium.components.subresource_filter"
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [ "java/src/org/chromium/components/subresource_filter/AdsBlockedDialogTest.java" ]
|
||||
|
||||
|
@ -24,9 +24,7 @@ android_library("variations_java") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("components_variations_junit_tests") {
|
||||
# Platform checks are broken for Robolectric. See https://crbug.com/1071638.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("components_variations_junit_tests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"junit/src/org/chromium/components/variations/VariationsCompressionUtilsTest.java",
|
||||
|
@ -17,9 +17,7 @@ android_library("java") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"src/org/chromium/components/webapk/lib/client/WebApkValidatorTest.java",
|
||||
|
@ -161,9 +161,7 @@ source_set("unit_tests") {
|
||||
]
|
||||
}
|
||||
|
||||
java_library("junit") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("junit") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"java/src/org/chromium/components/webapps/AddToHomescreenDialogViewTest.java",
|
||||
|
@ -640,6 +640,7 @@ junit_binary("content_junit_tests") {
|
||||
"junit/src/org/chromium/content/browser/sms/SmsProviderGmsTest.java",
|
||||
"junit/src/org/chromium/content_public/browser/MessagePayloadTest.java",
|
||||
]
|
||||
|
||||
deps = [
|
||||
":content_java",
|
||||
"//base:base_java",
|
||||
@ -656,9 +657,10 @@ junit_binary("content_junit_tests") {
|
||||
"//third_party/androidx:androidx_test_runner_java",
|
||||
"//third_party/blink/public/mojom:android_mojo_bindings_java",
|
||||
"//third_party/hamcrest:hamcrest_java",
|
||||
"//third_party/junit",
|
||||
"//third_party/mockito:mockito_java",
|
||||
"//ui/android:ui_java",
|
||||
"//ui/gfx/geometry/mojom:mojom_java",
|
||||
]
|
||||
|
||||
data_deps = [ "//testing/buildbot/filters:content_junit_tests_filters" ]
|
||||
}
|
||||
|
@ -6,10 +6,7 @@ assert(is_android)
|
||||
|
||||
import("//build/config/android/rules.gni")
|
||||
|
||||
java_library("junit_test_support") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
testonly = true
|
||||
robolectric_library("junit_test_support") {
|
||||
sources = [
|
||||
"java/src/org/chromium/testing/local/CustomShadowApplicationPackageManager.java",
|
||||
"java/src/org/chromium/testing/local/GtestComputer.java",
|
||||
|
11
third_party/android_deps/BUILD.gn
vendored
11
third_party/android_deps/BUILD.gn
vendored
@ -30,10 +30,6 @@ if (!limit_android_deps) {
|
||||
java_group("robolectric_all_java") {
|
||||
testonly = true
|
||||
|
||||
# Prevent 'gn format' from sorting deps. In order for the classpath to be
|
||||
# correct, newer robolectric android-all versions should be listed below older
|
||||
# versions.
|
||||
# NOSORT
|
||||
deps = [
|
||||
":org_robolectric_annotations_java",
|
||||
":org_robolectric_junit_java",
|
||||
@ -48,9 +44,12 @@ if (!limit_android_deps) {
|
||||
":org_robolectric_shadows_playservices_java",
|
||||
":org_robolectric_utils_java",
|
||||
":org_robolectric_utils_reflector_java",
|
||||
]
|
||||
|
||||
"//third_party/robolectric:robolectric_runtime_jars",
|
||||
"//third_party/robolectric:android-all-10-robolectric-5803371_java",
|
||||
# Temporarily keep compiling against robolectric until every target is
|
||||
# migarated to robolectric_library. See https://crbug.com/1296632
|
||||
input_jars_paths = [
|
||||
"//third_party/robolectric/lib/android-all-12-robolectric-7732740.jar",
|
||||
]
|
||||
}
|
||||
|
||||
|
19
third_party/robolectric/3pp/fetch.py
vendored
19
third_party/robolectric/3pp/fetch.py
vendored
@ -9,6 +9,7 @@ import os
|
||||
|
||||
_PATCH = 'cr2'
|
||||
_LATEST_VERSION = '12-robolectric-7732740.' + _PATCH
|
||||
# All instrumented jars + latest non-instrumented one.
|
||||
_ROBO_URL_FILES = {
|
||||
'android-all-instrumented-12-robolectric-7732740-i3.jar':
|
||||
'https://repo1.maven.org/maven2/org/robolectric/android-all-instrumented/12-robolectric-7732740-i3/android-all-instrumented-12-robolectric-7732740-i3.jar',
|
||||
@ -32,24 +33,6 @@ _ROBO_URL_FILES = {
|
||||
'https://repo1.maven.org/maven2/org/robolectric/android-all-instrumented/4.4_r1-robolectric-r2-i3/android-all-instrumented-4.4_r1-robolectric-r2-i3.jar',
|
||||
'android-all-12-robolectric-7732740.jar':
|
||||
'https://repo1.maven.org/maven2/org/robolectric/android-all/12-robolectric-7732740/android-all-12-robolectric-7732740.jar',
|
||||
'android-all-11-robolectric-6757853.jar':
|
||||
'https://repo.maven.apache.org/maven2/org/robolectric/android-all/11-robolectric-6757853/android-all-11-robolectric-6757853.jar',
|
||||
'android-all-10-robolectric-5803371.jar':
|
||||
'https://repo1.maven.org/maven2/org/robolectric/android-all/10-robolectric-5803371/android-all-10-robolectric-5803371.jar',
|
||||
'android-all-9-robolectric-4913185-2.jar':
|
||||
'https://repo1.maven.org/maven2/org/robolectric/android-all/9-robolectric-4913185-2/android-all-9-robolectric-4913185-2.jar',
|
||||
'android-all-8.1.0-robolectric-4611349.jar':
|
||||
'https://repo1.maven.org/maven2/org/robolectric/android-all/8.1.0-robolectric-4611349/android-all-8.1.0-robolectric-4611349.jar',
|
||||
'android-all-8.0.0_r4-robolectric-r1.jar':
|
||||
'https://repo1.maven.org/maven2/org/robolectric/android-all/8.0.0_r4-robolectric-r1/android-all-8.0.0_r4-robolectric-r1.jar',
|
||||
'android-all-7.1.0_r7-robolectric-r1.jar':
|
||||
'https://repo1.maven.org/maven2/org/robolectric/android-all/7.1.0_r7-robolectric-r1/android-all-7.1.0_r7-robolectric-r1.jar',
|
||||
'android-all-6.0.1_r3-robolectric-r1.jar':
|
||||
'https://repo1.maven.org/maven2/org/robolectric/android-all/6.0.1_r3-robolectric-r1/android-all-6.0.1_r3-robolectric-r1.jar',
|
||||
'android-all-5.0.2_r3-robolectric-r0.jar':
|
||||
'https://repo1.maven.org/maven2/org/robolectric/android-all/5.0.2_r3-robolectric-r0/android-all-5.0.2_r3-robolectric-r0.jar',
|
||||
'android-all-4.4_r1-robolectric-r2.jar':
|
||||
'https://repo1.maven.org/maven2/org/robolectric/android-all/4.4_r1-robolectric-r2/android-all-4.4_r1-robolectric-r2.jar',
|
||||
}
|
||||
|
||||
def do_latest():
|
||||
|
10
third_party/robolectric/BUILD.gn
vendored
10
third_party/robolectric/BUILD.gn
vendored
@ -16,11 +16,13 @@ group("robolectric_runtime_jars") {
|
||||
"//third_party/robolectric/lib/android-all-instrumented-9-robolectric-4913185-2-i3.jar",
|
||||
"//third_party/robolectric/lib/android-all-instrumented-10-robolectric-5803371-i3.jar",
|
||||
"//third_party/robolectric/lib/android-all-instrumented-11-robolectric-6757853-i3.jar",
|
||||
"//third_party/robolectric/lib/android-all-instrumented-12-robolectric-7732740-i3.jar",
|
||||
]
|
||||
}
|
||||
|
||||
java_prebuilt("android-all-10-robolectric-5803371_java") {
|
||||
enable_bytecode_checks = false
|
||||
testonly = true
|
||||
jar_path = "lib/android-all-10-robolectric-5803371.jar"
|
||||
# Robolectric tests compile against the robolectric sdk. This should be kept in
|
||||
# sync with the latest version in //third_party/android_sdk.
|
||||
android_system_java_prebuilt("robolectric_test_sdk_java") {
|
||||
jar_path =
|
||||
"//third_party/robolectric/lib/android-all-12-robolectric-7732740.jar"
|
||||
}
|
||||
|
@ -403,9 +403,7 @@ java_group("ui_full_java") {
|
||||
]
|
||||
}
|
||||
|
||||
android_library("ui_junit_test_support") {
|
||||
# Skip platform checks since Robolectric depends on requires_android targets.
|
||||
bypass_platform_checks = true
|
||||
robolectric_library("ui_junit_test_support") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"junit/src/org/chromium/ui/shadows/ShadowAnimatedStateListDrawable.java",
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user