5package dev.flutter.scenariosui;
7import android.app.Instrumentation;
9import android.content.pm.ActivityInfo;
10import androidx.annotation.NonNull;
11import androidx.test.ext.junit.runners.AndroidJUnit4;
12import androidx.test.filters.LargeTest;
13import androidx.test.platform.app.InstrumentationRegistry;
14import androidx.test.rule.ActivityTestRule;
15import dev.flutter.scenarios.PlatformViewsActivity;
16import org.junit.Before;
19import org.junit.runner.RunWith;
21@RunWith(AndroidJUnit4.class)
24 private Instrumentation instrumentation;
25 private Intent intent;
29 new ActivityTestRule<>(
32 private static String goldName(String
suffix) {
33 return "PlatformViewWithTextureViewUiTest_" +
suffix;
38 instrumentation = InstrumentationRegistry.getInstrumentation();
39 intent =
new Intent(Intent.ACTION_MAIN);
45 intent.putExtra(
"scenario_name",
"platform_view");
51 intent.putExtra(
"scenario_name",
"platform_view_multiple");
53 activityRule.launchActivity(intent), goldName(
"testPlatformViewMultiple"));
58 intent.putExtra(
"scenario_name",
"platform_view_multiple_background_foreground");
61 goldName(
"testPlatformViewMultipleBackgroundForeground"));
66 intent.putExtra(
"scenario_name",
"platform_view_cliprect");
68 activityRule.launchActivity(intent), goldName(
"testPlatformViewCliprect"));
73 intent.putExtra(
"scenario_name",
"platform_view_cliprrect");
75 activityRule.launchActivity(intent), goldName(
"testPlatformViewCliprrect"));
80 intent.putExtra(
"scenario_name",
"platform_view_clippath");
82 activityRule.launchActivity(intent), goldName(
"testPlatformViewClippath"));
87 intent.putExtra(
"scenario_name",
"platform_view_transform");
89 activityRule.launchActivity(intent), goldName(
"testPlatformViewTransform"));
94 intent.putExtra(
"scenario_name",
"platform_view_opacity");
96 activityRule.launchActivity(intent), goldName(
"testPlatformViewOpacity"));
101 intent.putExtra(
"scenario_name",
"platform_view_rotate");
103 activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
104 instrumentation.waitForIdleSync();
110 intent.putExtra(
"scenario_name",
"platform_view_multiple_without_overlays");
112 activityRule.launchActivity(intent), goldName(
"testPlatformViewMultipleWithoutOverlays"));
117 intent.putExtra(
"scenario_name",
"platform_view_two_intersecting_overlays");
119 activityRule.launchActivity(intent), goldName(
"testPlatformViewTwoIntersectingOverlays"));
124 intent.putExtra(
"scenario_name",
"platform_view_no_overlay_intersection");
127 goldName(
"testPlatformViewWithoutOverlayIntersection"));
void testPlatformViewRotate()
void testPlatformViewOpacity()
void testPlatformViewMultipleBackgroundForeground()
void testPlatformViewCliprrect()
void testPlatformViewTwoIntersectingOverlays()
void testPlatformViewMultipleWithoutOverlays()
ActivityTestRule< PlatformViewsActivity > activityRule
void testPlatformViewCliprect()
void testPlatformViewWithoutOverlayIntersection()
void testPlatformViewClippath()
void testPlatformViewTransform()
void testPlatformViewMultiple()
static void capture(@NonNull TestableFlutterActivity activity, @NonNull String captureName)