Setup NativeTestServer
this adds the classes dependent on the nativetestserverThis adds the classes dependent on the nativetestserver. This setup depends on the cronet's platform implementation. However, the tests jnilib is not prefixed and because of that: - We don't jarjar the base classes - Don't jar the test classes since the .so file needs the unjarjared versions. Test: atest NetHttpTestServer Bug: 267353182 Change-Id: Id5cfc8f842df4b13cef6f56dbaa6b9563c3989de
This commit is contained in:
@@ -35,7 +35,7 @@ android_test {
|
|||||||
"CtsNetHttpTestsLib",
|
"CtsNetHttpTestsLib",
|
||||||
"NetHttpTestsLibPreJarJar",
|
"NetHttpTestsLibPreJarJar",
|
||||||
],
|
],
|
||||||
jarjar_rules: ":framework-tethering-jarjar-rules",
|
jarjar_rules: ":net-http-test-jarjar-rules",
|
||||||
compile_multilib: "both", // Include both the 32 and 64 bit versions
|
compile_multilib: "both", // Include both the 32 and 64 bit versions
|
||||||
jni_libs: [
|
jni_libs: [
|
||||||
"//external/cronet:cronet_aml_components_cronet_android_cronet_tests__testing"
|
"//external/cronet:cronet_aml_components_cronet_android_cronet_tests__testing"
|
||||||
|
|||||||
@@ -17,12 +17,30 @@ package {
|
|||||||
default_applicable_licenses: ["Android-Apache-2.0"],
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
java_genrule {
|
||||||
|
name: "net-http-test-jarjar-rules",
|
||||||
|
tool_files: [
|
||||||
|
":NetHttpTestsLibPreJarJar{.jar}",
|
||||||
|
"jarjar_excludes.txt",
|
||||||
|
],
|
||||||
|
tools: [
|
||||||
|
"jarjar-rules-generator",
|
||||||
|
],
|
||||||
|
out: ["net_http_test_jarjar_rules.txt"],
|
||||||
|
cmd: "$(location jarjar-rules-generator) " +
|
||||||
|
"$(location :NetHttpTestsLibPreJarJar{.jar}) " +
|
||||||
|
"--prefix android.net.http.internal " +
|
||||||
|
"--excludes $(location jarjar_excludes.txt) " +
|
||||||
|
"--output $(out)",
|
||||||
|
}
|
||||||
|
|
||||||
android_library {
|
android_library {
|
||||||
name: "NetHttpTestsLibPreJarJar",
|
name: "NetHttpTestsLibPreJarJar",
|
||||||
srcs: ["//external/cronet:cronet_aml_javatests_sources"],
|
srcs: ["//external/cronet:cronet_aml_javatests_sources"],
|
||||||
sdk_version: "test_current",
|
sdk_version: "module_current",
|
||||||
min_sdk_version: "30",
|
min_sdk_version: "30",
|
||||||
static_libs: [
|
static_libs: [
|
||||||
|
"//external/cronet:cronet_testserver_utils",
|
||||||
"androidx.test.ext.junit",
|
"androidx.test.ext.junit",
|
||||||
"androidx.test.rules",
|
"androidx.test.rules",
|
||||||
"junit",
|
"junit",
|
||||||
@@ -41,7 +59,7 @@ android_test {
|
|||||||
"mts-target-sdk-version-current",
|
"mts-target-sdk-version-current",
|
||||||
],
|
],
|
||||||
static_libs: ["NetHttpTestsLibPreJarJar"],
|
static_libs: ["NetHttpTestsLibPreJarJar"],
|
||||||
jarjar_rules: ":framework-tethering-jarjar-rules",
|
jarjar_rules: ":net-http-test-jarjar-rules",
|
||||||
jni_libs: [
|
jni_libs: [
|
||||||
"//external/cronet:cronet_aml_components_cronet_android_cronet_tests__testing"
|
"//external/cronet:cronet_aml_components_cronet_android_cronet_tests__testing"
|
||||||
],
|
],
|
||||||
|
|||||||
10
Cronet/tests/mts/jarjar_excludes.txt
Normal file
10
Cronet/tests/mts/jarjar_excludes.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# It's prohibited to jarjar androidx packages
|
||||||
|
androidx\..+
|
||||||
|
# Do not jarjar the api classes
|
||||||
|
android\.net\..+
|
||||||
|
# cronet_tests.so is not jarjared and uses base classes. We can remove this when there's a
|
||||||
|
# separate java base target to depend on.
|
||||||
|
org\.chromium\.base\..+
|
||||||
|
# Do not jarjar the tests and its utils as they also do JNI with cronet_tests.so
|
||||||
|
org\.chromium\.net\..*Test.*(\$.+)?
|
||||||
|
org\.chromium\.net\.NativeTestServer(\$.+)?
|
||||||
Reference in New Issue
Block a user