From 9cb7bf430b3efe5179398e05f9ad43a7f614d848 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Wed, 21 Feb 2024 11:21:53 -0800 Subject: [PATCH] Add the `scenario_app` `'solid_blue'` golden to the Android test suite (flutter/engine#50801) This test is already running in the iOS scenario app: ![DrawSolidBlueScreenTest](https://github.com/flutter/engine/assets/168174/1b499348-f854-4e2d-aa41-f8c6b9ec616d) It should help debug https://github.com/flutter/flutter/issues/143602 by showing if the Android UI is bleeding. --- .../scenariosui/DrawSolidBlueScreenTest.java | 27 +++++++++++++++++++ .../testing/scenario_app_android_output.txt | 1 + 2 files changed, 28 insertions(+) create mode 100644 engine/src/flutter/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/DrawSolidBlueScreenTest.java diff --git a/engine/src/flutter/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/DrawSolidBlueScreenTest.java b/engine/src/flutter/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/DrawSolidBlueScreenTest.java new file mode 100644 index 0000000000..b61a69f784 --- /dev/null +++ b/engine/src/flutter/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/DrawSolidBlueScreenTest.java @@ -0,0 +1,27 @@ +package dev.flutter.scenariosui; + +import android.content.Intent; +import androidx.annotation.NonNull; +import androidx.test.filters.LargeTest; +import androidx.test.rule.ActivityTestRule; +import androidx.test.runner.AndroidJUnit4; +import dev.flutter.scenarios.PlatformViewsActivity; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +@RunWith(AndroidJUnit4.class) +@LargeTest +public final class DrawSolidBlueScreenTest { + @Rule @NonNull + public ActivityTestRule activityRule = + new ActivityTestRule<>( + PlatformViewsActivity.class, /*initialTouchMode=*/ false, /*launchActivity=*/ false); + + @Test + public void test() throws Exception { + Intent intent = new Intent(Intent.ACTION_MAIN); + intent.putExtra("scenario_name", "solid_blue"); + ScreenshotUtil.capture(activityRule.launchActivity(intent), "DrawSolidBlueScreenTest"); + } +} diff --git a/engine/src/flutter/testing/scenario_app_android_output.txt b/engine/src/flutter/testing/scenario_app_android_output.txt index 49a7bc30e9..da412e233e 100644 --- a/engine/src/flutter/testing/scenario_app_android_output.txt +++ b/engine/src/flutter/testing/scenario_app_android_output.txt @@ -1,3 +1,4 @@ +DrawSolidBlueScreenTest.png ExternalTextureTests_testCanvasSurface.png ExternalTextureTests_testCroppedMediaSurface_bottomLeft.png ExternalTextureTests_testCroppedMediaSurface_topRight.png