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

Commit d36af8f

Browse files
committed
Fix test
1 parent 72a88b5 commit d36af8f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ public void getBitmap() throws Exception {
3333
Bitmap bitmap = activity.getBitmap();
3434

3535
assertEquals(bitmap.getPixel(10, 10), 0xFFFF0000);
36-
assertEquals(bitmap.getPixel(10, 10), 0xFF0000FF);
36+
assertEquals(bitmap.getPixel(10, 210), 0xFF00FF00);
3737
}
3838
}

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,17 @@
99

1010
public class GetBitmapActivity extends TestActivity {
1111

12+
@Nullable private volatile Bitmap bitmap;
13+
1214
@Nullable
1315
public Bitmap getBitmap() {
1416
waitUntilFlutterRendered();
15-
return getFlutterEngine().getRenderer().getBitmap();
17+
return bitmap;
18+
}
19+
20+
@Nullable
21+
protected void notifyFlutterRendered() {
22+
bitmap = getFlutterEngine().getRenderer().getBitmap();
23+
super.notifyFlutterRendered();
1624
}
1725
}

0 commit comments

Comments
 (0)