Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 0370314

Browse files
authored
Revert "Re-enable scenario tests on Android (#33574)"
This reverts commit ada245a.
1 parent 9e0316d commit 0370314

File tree

58 files changed

+329
-722
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+329
-722
lines changed

.ci.yaml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,24 +100,16 @@ targets:
100100
timeout: 60
101101

102102
- name: Linux Android Emulator Tests
103+
bringup: true # Recipe issue https://github.com/flutter/flutter/issues/86427
103104
recipe: engine/scenarios
104-
enabled_branches:
105-
- main
106-
- master
107105
properties:
108106
dependencies: >-
109107
[
110-
{"dependency": "android_virtual_device", "version": "31"},
111-
{"dependency": "goldctl"}
108+
{"dependency": "android_virtual_device", "version": "31"}
112109
]
113110
upload_packages: "true"
114111
clobber: "true"
115112
timeout: 60
116-
runIf:
117-
- DEPS
118-
- .ci.yaml
119-
- testing/**
120-
- shell/platforms/android/**
121113

122114
- name: Linux Benchmarks
123115
enabled_branches:

shell/platform/android/android_context_gl_unittests.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ TEST(AndroidSurfaceGL, CreateSnapshopSurfaceWhenOnscreenSurfaceIsNull) {
164164
EXPECT_NE(android_surface->GetOnscreenSurface(), nullptr);
165165
}
166166

167-
// TODO(https://github.com/flutter/flutter/issues/104463): Flaky test.
168-
TEST(AndroidContextGl, DISABLED_MSAAx4) {
167+
TEST(AndroidContextGl, MSAAx4) {
169168
GrMockOptions main_context_options;
170169
sk_sp<GrDirectContext> main_context =
171170
GrDirectContext::MakeMock(&main_context_options);

shell/platform/android/external_view_embedder/external_view_embedder.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ void AndroidExternalViewEmbedder::SubmitFrame(
9898

9999
for (size_t i = 0; i < current_frame_view_count; i++) {
100100
int64_t view_id = composition_order_[i];
101-
if (picture_recorders_.at(view_id)->getRecordingCanvas() == nullptr) {
102-
continue;
103-
}
104101

105102
sk_sp<SkPicture> picture =
106103
picture_recorders_.at(view_id)->finishRecordingAsPicture();

testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/ScreenshotUtil.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ private static class Connection {
3737
}
3838

3939
synchronized void writeFile(String name, byte[] fileContent) throws IOException {
40-
final ByteBuffer buffer = ByteBuffer.allocate(name.length() + fileContent.length + 8);
41-
// See ScreenshotBlobTransformer#bind in screenshot_transformer.dart for consumer side.
40+
final ByteBuffer buffer = ByteBuffer.allocate(name.length() + fileContent.length + 4);
4241
buffer.putInt(name.length());
43-
buffer.putInt(fileContent.length);
4442
buffer.put(name.getBytes());
4543
buffer.put(fileContent);
4644
final byte[] bytes = buffer.array();
@@ -120,9 +118,6 @@ public static void capture(@NonNull TestableFlutterActivity activity, @NonNull S
120118

121119
final Bitmap bitmap =
122120
InstrumentationRegistry.getInstrumentation().getUiAutomation().takeScreenshot();
123-
if (bitmap == null) {
124-
throw new RuntimeException("failed to capture screenshot");
125-
}
126121
final ByteArrayOutputStream out = new ByteArrayOutputStream();
127122
bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
128123
ScreenshotUtil.writeFile(captureName, out.toByteArray());

testing/scenario_app/android/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
android:hardwareAccelerated="true"
1515
android:launchMode="singleTop"
1616
android:windowSoftInputMode="adjustResize"
17+
android:theme="@style/FullScreenScreenshot"
1718
android:exported="true">
1819
<intent-filter>
1920
<action android:name="com.google.intent.action.TEST_LOOP" />
@@ -31,6 +32,7 @@
3132
android:hardwareAccelerated="true"
3233
android:launchMode="singleTop"
3334
android:windowSoftInputMode="adjustResize"
35+
android:theme="@style/FullScreenScreenshot"
3436
android:exported="true">
3537
<intent-filter>
3638
<action android:name="android.intent.action.MAIN" />
@@ -43,6 +45,7 @@
4345
android:hardwareAccelerated="true"
4446
android:launchMode="singleTop"
4547
android:windowSoftInputMode="adjustResize"
48+
android:theme="@style/FullScreenScreenshot"
4649
android:exported="true">
4750
<intent-filter>
4851
<action android:name="android.intent.action.MAIN" />

testing/scenario_app/android/app/src/main/java/dev/flutter/scenarios/TestActivity.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,8 @@
1212
import android.os.Bundle;
1313
import android.os.Handler;
1414
import android.os.Looper;
15-
import android.view.Window;
1615
import androidx.annotation.NonNull;
1716
import androidx.annotation.Nullable;
18-
import androidx.core.view.WindowCompat;
19-
import androidx.core.view.WindowInsetsCompat;
20-
import androidx.core.view.WindowInsetsControllerCompat;
2117
import io.flutter.Log;
2218
import io.flutter.embedding.engine.FlutterShellArgs;
2319
import io.flutter.embedding.engine.loader.FlutterLoader;
@@ -39,8 +35,6 @@ public abstract class TestActivity extends TestableFlutterActivity {
3935
@Override
4036
protected void onCreate(@Nullable Bundle savedInstanceState) {
4137
super.onCreate(savedInstanceState);
42-
hideSystemBars(getWindow());
43-
4438
final Intent launchIntent = getIntent();
4539
if ("com.google.intent.action.TEST_LOOP".equals(launchIntent.getAction())) {
4640
if (Build.VERSION.SDK_INT > 22) {
@@ -164,12 +158,4 @@ public void run() {
164158
}
165159
});
166160
}
167-
168-
private static void hideSystemBars(Window window) {
169-
final WindowInsetsControllerCompat insetController =
170-
WindowCompat.getInsetsController(window, window.getDecorView());
171-
insetController.setSystemBarsBehavior(
172-
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
173-
insetController.hide(WindowInsetsCompat.Type.systemBars());
174-
}
175161
}

testing/scenario_app/android/app/src/main/res/values/styles.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,11 @@
88
<item name="colorAccent">@color/colorAccent</item>
99
</style>
1010

11+
<style name="FullScreenScreenshot">
12+
<item name="android:windowNoTitle">true</item>
13+
<item name="android:windowActionBar">false</item>
14+
<item name="android:windowFullscreen">true</item>
15+
<item name="android:windowContentOverlay">@null</item>
16+
</style>
17+
1118
</resources>

0 commit comments

Comments
 (0)