Commit 88322140 authored by mikecase's avatar mikecase Committed by Commit bot

Add initial test and build files for Robolectric unit test suites.

Robolectric allows us to run tests that use Android code in the host
JVM. This means faster and more stable tests since we don't have to
deal with a device. This CL has the build file changes to build the
unit test suite, and two example tests that have been converted to
run with Robolectric.

BUG=448030

Review URL: https://codereview.chromium.org/994283006

Cr-Commit-Position: refs/heads/master@{#322512}
parent 4c27bf72
......@@ -447,6 +447,19 @@ android_apk("chrome_shell_test_apk") {
android_manifest = "shell/javatests/AndroidManifest.xml"
}
# GYP: //chrome/chrome_tests.gypi:chrome_shell_unit_tests
java_binary("chrome_shell_unit_tests") {
testonly = true
java_files = [ "android/junit/src/org/chromium/chrome/browser/omaha/ResponseParserTest.java" ]
main_class = "org.chromium.testing.local.JunitTestMain"
deps = [
":chrome_java",
"//base:base_java",
"//base:base_java_test_support",
"//testing/android/junit:junit_test_support",
]
}
# GYP: //chrome/chrome_tests.gypi:chrome_sync_shell_test_apk
android_apk("chrome_sync_shell_test_apk") {
testonly = true
......
......@@ -2926,6 +2926,26 @@
},
'includes': [ '../build/java_apk.gypi' ],
},
{
# GN: //chrome/android:chrome_shell_unit_tests
'target_name': 'chrome_shell_unit_tests',
'type': 'none',
'dependencies': [
'chrome_java',
'../base/base.gyp:base',
'../base/base.gyp:base_java_test_support',
'../testing/android/junit/junit_test.gyp:junit_test_support',
],
'variables': {
'main_class': 'org.chromium.testing.local.JunitTestMain',
'src_paths': [
'android/junit/',
],
},
'includes': [
'../build/host_jar.gypi',
],
},
{
# GN: //chrome/test/chromedriver/test/webview_shell:chromedriver_webview_shell_apk
'target_name': 'chromedriver_webview_shell_apk',
......
......@@ -2026,6 +2026,26 @@
},
'includes': [ '../build/java_apk.gypi' ],
},
{
# GN: //content/public/android:content_shell_unit_tests
'target_name': 'content_shell_unit_tests',
'type': 'none',
'dependencies': [
'content.gyp:content_java',
'../base/base.gyp:base_java',
'../base/base.gyp:base_java_test_support',
'../testing/android/junit/junit_test.gyp:junit_test_support',
],
'variables': {
'main_class': 'org.chromium.testing.local.JunitTestMain',
'src_paths': [
'public/android/junit/',
],
},
'includes': [
'../build/host_jar.gypi',
],
},
],
}],
['OS!="android" and OS!="ios" and OS!="linux"', {
......
......@@ -178,4 +178,17 @@ android_library("content_javatests") {
DEPRECATED_java_in_dir = "javatests/src"
}
# GYP: //content/content_tests.gypi:content_shell_unit_tests
java_binary("chrome_shell_unit_tests") {
testonly = true
java_files = [ "junit/src/org/chromium/content/browser/input/GamepadMappingsTest.java" ]
main_class = "org.chromium.testing.local.JunitTestMain"
deps = [
":content_java",
"//base:base_java",
"//base:base_java_test_support",
"//testing/android/junit:junit_test_support",
]
}
# TODO(GYP): content_icudata
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment