From aca5f2d294e026013bf1084869e866da6779d4a2 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Tue, 20 Feb 2024 16:04:38 -0800 Subject: [PATCH 1/4] Add the `solid_blue` scenario to the Android scenario app to debug background color. --- .../scenariosui/DrawSolidBlueScreenTest.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/DrawSolidBlueScreenTest.java diff --git a/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/DrawSolidBlueScreenTest.java b/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/DrawSolidBlueScreenTest.java new file mode 100644 index 0000000000000..b41fabbf19334 --- /dev/null +++ b/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/DrawSolidBlueScreenTest.java @@ -0,0 +1,33 @@ +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 org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import dev.flutter.scenarios.PlatformViewsActivity; + +@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"); + } +} From 7cc66b514ce362ee215f542bc34a0e1a2deea337 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Tue, 20 Feb 2024 16:05:26 -0800 Subject: [PATCH 2/4] Fmt. --- .../scenariosui/DrawSolidBlueScreenTest.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/DrawSolidBlueScreenTest.java b/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/DrawSolidBlueScreenTest.java index b41fabbf19334..b61a69f7848bd 100644 --- a/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/DrawSolidBlueScreenTest.java +++ b/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/DrawSolidBlueScreenTest.java @@ -1,28 +1,22 @@ 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; -import dev.flutter.scenarios.PlatformViewsActivity; - @RunWith(AndroidJUnit4.class) @LargeTest public final class DrawSolidBlueScreenTest { - @Rule - @NonNull + @Rule @NonNull public ActivityTestRule activityRule = - new ActivityTestRule<>( - PlatformViewsActivity.class, - /*initialTouchMode=*/ false, - /*launchActivity=*/ false); + new ActivityTestRule<>( + PlatformViewsActivity.class, /*initialTouchMode=*/ false, /*launchActivity=*/ false); @Test public void test() throws Exception { From 0f007dc9c9271c164f3a9835c0129e4ebae6f9af Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Tue, 20 Feb 2024 16:33:39 -0800 Subject: [PATCH 3/4] ++ --- testing/scenario_app_android_output.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/testing/scenario_app_android_output.txt b/testing/scenario_app_android_output.txt index 49a7bc30e9e7a..05033e6ffeb01 100644 --- a/testing/scenario_app_android_output.txt +++ b/testing/scenario_app_android_output.txt @@ -6,6 +6,7 @@ ExternalTextureTests_testMediaSurface.png ExternalTextureTests_testRotatedMediaSurface_180.png ExternalTextureTests_testRotatedMediaSurface_270.png ExternalTextureTests_testRotatedMediaSurface_90.png +DrawSolidBlueScreenTest.png PlatformTextureUiTests_testPlatformView.png PlatformTextureUiTests_testPlatformViewClippath.png PlatformTextureUiTests_testPlatformViewCliprect.png From 5f993e35e04f0668894346abaef188d45220ecdb Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Tue, 20 Feb 2024 17:16:02 -0800 Subject: [PATCH 4/4] ++ --- testing/scenario_app_android_output.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/scenario_app_android_output.txt b/testing/scenario_app_android_output.txt index 05033e6ffeb01..da412e233e0ce 100644 --- a/testing/scenario_app_android_output.txt +++ b/testing/scenario_app_android_output.txt @@ -1,3 +1,4 @@ +DrawSolidBlueScreenTest.png ExternalTextureTests_testCanvasSurface.png ExternalTextureTests_testCroppedMediaSurface_bottomLeft.png ExternalTextureTests_testCroppedMediaSurface_topRight.png @@ -6,7 +7,6 @@ ExternalTextureTests_testMediaSurface.png ExternalTextureTests_testRotatedMediaSurface_180.png ExternalTextureTests_testRotatedMediaSurface_270.png ExternalTextureTests_testRotatedMediaSurface_90.png -DrawSolidBlueScreenTest.png PlatformTextureUiTests_testPlatformView.png PlatformTextureUiTests_testPlatformViewClippath.png PlatformTextureUiTests_testPlatformViewCliprect.png