Skip to content

Commit

Permalink
Move WebAPK tests with additional_apks to dedicated test suite
Browse files Browse the repository at this point in the history
This CL moves to the chrome_webapk_integration_tests test suite:
//chrome/android/webapk/libs/runtime_library:runtime_library_javatests
//chrome/android/webapk/shell_apk:shell_apk_javatests

The purpose of the move is to:
- Avoid cluttering the app list when running non-WebAPK tests.
- Prepare for adding additional additional_apks for WebAPK integration
tests

BUG=1237029

Change-Id: I15938fa324de6eafe01a9c08f12bd0bba02c2860
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3078663
Commit-Queue: Peter Kotwicz <[email protected]>
Reviewed-by: Dirk Pranke <[email protected]>
Reviewed-by: Yaron Friedman <[email protected]>
Cr-Commit-Position: refs/heads/main@{#917323}
  • Loading branch information
pkotwicz authored and Chromium LUCI CQ committed Sep 1, 2021
1 parent a6a6b29 commit f37ec11
Show file tree
Hide file tree
Showing 9 changed files with 828 additions and 293 deletions.
4 changes: 0 additions & 4 deletions chrome/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2984,8 +2984,6 @@ chrome_test_apk_tmpl("chrome_public_test_apk") {
":chrome_test_java",
"//chrome/android/features/autofill_assistant:test_java",
"//chrome/android/features/keyboard_accessory:test_java",
"//chrome/android/webapk/libs/runtime_library:runtime_library_javatests",
"//chrome/android/webapk/shell_apk:shell_apk_javatests",
"//chrome/browser/banners/android:javatests",
"//chrome/browser/download/android:download_java_tests",
"//chrome/browser/engagement/android:javatests",
Expand All @@ -3011,9 +3009,7 @@ chrome_test_apk_tmpl("chrome_public_test_apk") {
enforce_resource_overlays_in_tests = true

additional_apks = [
"//chrome/android/webapk/libs/runtime_library/javatests/apk_with_webapk_service:apk_with_webapk_service",
"//chrome/android/webapk/shell_apk:javatests_webapk",
"//chrome/android/webapk/shell_apk/javatests/dex_optimizer:dex_optimizer_apk",
"//chrome/test/android/chrome_public_test_support:chrome_public_test_support_apk",
"//components/media_router/test/android/media_router_test_support:media_router_test_support_apk",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public void testCreateAndImmediatelyScreenshotSplashView() {
final int requestedSplashWidth = 1000;
final int requestedSplashHeight = 1000;
Bitmap screenshot = SplashUtils.createAndImmediatelyScreenshotSplashView(
InstrumentationRegistry.getTargetContext(), requestedSplashWidth,
requestedSplashHeight, 1024 * 1024 * 4 /* maxSizeBytes */);
InstrumentationRegistry.getContext(), requestedSplashWidth, requestedSplashHeight,
1024 * 1024 * 4 /* maxSizeBytes */);
Assert.assertNotNull(screenshot);
Assert.assertEquals(requestedSplashWidth, screenshot.getWidth());
Assert.assertEquals(requestedSplashHeight, screenshot.getHeight());
Expand Down
15 changes: 11 additions & 4 deletions chrome/test/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ instrumentation_test_apk("chrome_java_test_wpr_tests") {
}
}

instrumentation_test_apk("chrome_java_test_webapk_launch_tests") {
apk_name = "ChromeWebapkLaunchTests"
# WebAPK tests which require additional_apks should be in this test suite.
instrumentation_test_apk("chrome_webapk_integration_tests") {
apk_name = "ChromeWebApkIntegrationTests"
apk_under_test = "//chrome/android:chrome_public_apk"
android_manifest = "javatests/src/org/chromium/chrome/test/pagecontroller/tests/webapk/AndroidManifest.xml"
sources = [ "javatests/src/org/chromium/chrome/test/pagecontroller/tests/webapk/MapsGoFirstRunTest.java" ]
Expand All @@ -134,6 +135,8 @@ instrumentation_test_apk("chrome_java_test_webapk_launch_tests") {
"//base:base_java_test_support",
"//chrome/android:chrome_java",
"//chrome/android/webapk/libs/client:client_java",
"//chrome/android/webapk/libs/runtime_library:runtime_library_javatests",
"//chrome/android/webapk/shell_apk:shell_apk_javatests",
"//chrome/browser/first_run/android:java",
"//components/webapk/android/libs/client:java",
"//content/public/test/android:content_java_test_support",
Expand All @@ -142,8 +145,12 @@ instrumentation_test_apk("chrome_java_test_webapk_launch_tests") {
"//third_party/junit",
]

additional_apks =
[ "//chrome/android/webapk/shell_apk:uiautomator_maps_go_webapk" ]
additional_apks = [
"//chrome/android/webapk/libs/runtime_library/javatests/apk_with_webapk_service:apk_with_webapk_service",
"//chrome/android/webapk/shell_apk/javatests/dex_optimizer:dex_optimizer_apk",
"//chrome/android/webapk/shell_apk:javatests_webapk",
"//chrome/android/webapk/shell_apk:uiautomator_maps_go_webapk",
]

if (!is_java_debug) {
proguard_enabled = true
Expand Down
Loading

0 comments on commit f37ec11

Please sign in to comment.