[scenario_app] delete get bitmap activity. (flutter/engine#55436)
Since we can't see the screenshot we can't really evaluate if this is failing for good/bad reasons. This also uses the whoe convertToImageREader / readback debugging API that I want to delete.
This commit is contained in:
@@ -10,7 +10,6 @@ _android_sources = [
|
||||
"app/src/androidTest/java/dev/flutter/scenarios/ExampleInstrumentedTest.java",
|
||||
"app/src/androidTest/java/dev/flutter/scenariosui/DrawSolidBlueScreenTest.java",
|
||||
"app/src/androidTest/java/dev/flutter/scenariosui/ExternalTextureTests.java",
|
||||
"app/src/androidTest/java/dev/flutter/scenariosui/GetBitmapTests.java",
|
||||
"app/src/androidTest/java/dev/flutter/scenariosui/MemoryLeakTests.java",
|
||||
"app/src/androidTest/java/dev/flutter/scenariosui/PlatformTextureUiTests.java",
|
||||
"app/src/androidTest/java/dev/flutter/scenariosui/PlatformViewUiTests.java",
|
||||
@@ -25,7 +24,6 @@ _android_sources = [
|
||||
"app/src/main/AndroidManifest.xml",
|
||||
"app/src/main/assets/sample.mp4",
|
||||
"app/src/main/java/dev/flutter/scenarios/ExternalTextureFlutterActivity.java",
|
||||
"app/src/main/java/dev/flutter/scenarios/GetBitmapActivity.java",
|
||||
"app/src/main/java/dev/flutter/scenarios/PlatformViewsActivity.java",
|
||||
"app/src/main/java/dev/flutter/scenarios/SpawnMultiEngineActivity.java",
|
||||
"app/src/main/java/dev/flutter/scenarios/SpawnedEngineActivity.java",
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
package dev.flutter.scenariosui;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import androidx.test.filters.LargeTest;
|
||||
import androidx.test.rule.ActivityTestRule;
|
||||
import dev.flutter.scenarios.GetBitmapActivity;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class GetBitmapTests {
|
||||
@Rule @NonNull
|
||||
public ActivityTestRule<GetBitmapActivity> activityRule =
|
||||
new ActivityTestRule<>(
|
||||
GetBitmapActivity.class, /*initialTouchMode=*/ false, /*launchActivity=*/ false);
|
||||
|
||||
@Test
|
||||
public void getBitmap() throws Exception {
|
||||
Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||
intent.putExtra("scenario_name", "get_bitmap");
|
||||
GetBitmapActivity activity = activityRule.launchActivity(intent);
|
||||
Bitmap bitmap = activity.getBitmap();
|
||||
|
||||
assertEquals(bitmap.getPixel(10, 10), 0xFFFF0000);
|
||||
assertEquals(bitmap.getPixel(10, bitmap.getHeight() - 10), 0xFF0000FF);
|
||||
}
|
||||
}
|
||||
@@ -58,17 +58,5 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".GetBitmapActivity"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleTop"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
package dev.flutter.scenarios;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public class GetBitmapActivity extends TestActivity {
|
||||
|
||||
@Nullable private volatile Bitmap bitmap;
|
||||
|
||||
@Nullable
|
||||
public Bitmap getBitmap() {
|
||||
waitUntilFlutterRendered();
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected void notifyFlutterRendered() {
|
||||
bitmap = getFlutterEngine().getRenderer().getBitmap();
|
||||
super.notifyFlutterRendered();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user