forked from firka/flutter
Remove testing/android_background_image which does not run/exist on CI. (flutter/engine#51815)
I am guessing this just either served it's purpose (https://github.com/flutter/flutter/issues/26654, https://github.com/flutter/flutter/issues/26728) or didn't and was never followed up. I can't find any examples of it running on CI - I suspect if we want a test like this, we're better off just adding it to `scenario_app` versus creating more 1-off Android integration test environments.
This commit is contained in:
@@ -155,11 +155,6 @@ group("flutter") {
|
||||
(is_ios || is_android)) {
|
||||
public_deps += [ "//flutter/testing/scenario_app" ]
|
||||
}
|
||||
|
||||
if (is_android && flutter_runtime_mode == "profile" &&
|
||||
current_cpu == "arm64") {
|
||||
public_deps += [ "//flutter/testing/android_background_image" ]
|
||||
}
|
||||
}
|
||||
|
||||
group("unittests") {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
.packages
|
||||
pubspec.lock # This only has local dependencies in it.
|
||||
build/
|
||||
|
||||
ios/Scenarios/*.framework/
|
||||
ios/Scenarios/*.xcframework/
|
||||
android/app/libs/flutter.jar
|
||||
android/app/src/main/jniLibs/arm64-v8a/libapp.so
|
||||
android/gradle-home/.cache
|
||||
|
||||
!.vpython
|
||||
@@ -1,37 +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.
|
||||
|
||||
import("//flutter/build/dart/rules.gni")
|
||||
import("//flutter/testing/rules/runtime_mode.gni")
|
||||
|
||||
assert(is_android)
|
||||
|
||||
flutter_snapshot("android_background_image_snapshot") {
|
||||
main_dart = "lib/main.dart"
|
||||
package_config = ".dart_tool/package_config.json"
|
||||
}
|
||||
|
||||
if (!is_aot) {
|
||||
copy("copy_jit_assets") {
|
||||
visibility = [ ":*" ]
|
||||
sources = [
|
||||
"$target_gen_dir/isolate_snapshot_data",
|
||||
"$target_gen_dir/isolate_snapshot_instr",
|
||||
"$target_gen_dir/kernel_blob.bin",
|
||||
]
|
||||
outputs = [ "$root_out_dir/android_background_image/app/assets/flutter_assets/{{source_file_part}}" ]
|
||||
deps = [ ":android_background_image_snapshot" ]
|
||||
}
|
||||
}
|
||||
|
||||
group("android_background_image") {
|
||||
deps = [
|
||||
":android_background_image_snapshot",
|
||||
"android",
|
||||
]
|
||||
|
||||
if (!is_aot) {
|
||||
deps += [ ":copy_jit_assets" ]
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
# Android Background Image
|
||||
|
||||
A test application that verifies Picture.toImage in the background on Android.
|
||||
@@ -1,15 +0,0 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
.settings
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cache
|
||||
@@ -1,42 +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.
|
||||
|
||||
import("//flutter/testing/rules/android.gni")
|
||||
|
||||
_android_sources = [
|
||||
"app/build.gradle",
|
||||
"app/src/main/AndroidManifest.xml",
|
||||
"app/src/main/java/dev/flutter/android_background_image/MainActivity.java",
|
||||
"build.gradle",
|
||||
]
|
||||
|
||||
gradle_task("android_lint") {
|
||||
app_name = "android_background_image"
|
||||
task = "lint"
|
||||
gradle_project_dir = rebase_path(".")
|
||||
sources = _android_sources
|
||||
outputs =
|
||||
[ "$root_out_dir/android_background_image/reports/lint-results.xml" ]
|
||||
|
||||
deps = [ "//flutter/testing/android_background_image:android_background_image_snapshot" ]
|
||||
}
|
||||
|
||||
gradle_task("build_apk") {
|
||||
app_name = "android_background_image"
|
||||
task = "assembleDebug"
|
||||
gradle_project_dir = rebase_path(".")
|
||||
sources = _android_sources
|
||||
outputs = [ "$root_out_dir/android_background_image/app/outputs/apk/debug/app-debug.apk" ]
|
||||
|
||||
deps = [
|
||||
":android_lint",
|
||||
"//flutter/testing/android_background_image:android_background_image_snapshot",
|
||||
]
|
||||
}
|
||||
|
||||
copy("android") {
|
||||
sources = get_target_outputs(":build_apk")
|
||||
outputs = [ "$root_out_dir/firebase_apks/android_background_image.apk" ]
|
||||
deps = [ ":build_apk" ]
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/build
|
||||
@@ -1,62 +0,0 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
namespace 'dev.flutter.android_background_image'
|
||||
lintOptions {
|
||||
abortOnError true
|
||||
checkAllWarnings true
|
||||
showAll true
|
||||
warningsAsErrors true
|
||||
checkTestSources true
|
||||
htmlReport false
|
||||
xmlReport true
|
||||
xmlOutput file("${rootProject.buildDir}/reports/lint-results.xml")
|
||||
// UnpackedNativeCode can break stack unwinding - see b/193408481
|
||||
// NewerVersionAvailable and GradleDependency need to be taken care of
|
||||
// by a roller rather than as part of CI.
|
||||
// The others are irrelevant for a test application.
|
||||
disable 'UnpackedNativeCode','MissingApplicationIcon','GoogleAppIndexingApiWarning','GoogleAppIndexingWarning','GradleDependency','NewerVersionAvailable'
|
||||
}
|
||||
buildToolsVersion = '34.0.0'
|
||||
compileSdkVersion 34
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
defaultConfig {
|
||||
applicationId 'dev.flutter.android_background_image'
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 34
|
||||
versionCode 1
|
||||
versionName '1.0'
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
sourceSets.main {
|
||||
assets.srcDirs += "${project.buildDir}/assets"
|
||||
if (project.hasProperty('libapp')) {
|
||||
jni.srcDirs = []
|
||||
jniLibs.srcDirs = [project.property('libapp')]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Please *don't* add embedding dependencies to this file.
|
||||
// The embedding dependencies are configured in tools/androidx/files.json.
|
||||
// Only add test dependencies.
|
||||
|
||||
implementation files(project.property('flutter_jar'))
|
||||
}
|
||||
|
||||
// Configure the embedding dependencies.
|
||||
apply from: new File(rootDir, '../../../tools/androidx/configure.gradle').absolutePath;
|
||||
configureDependencies(new File(rootDir, '../../..')) { dependency ->
|
||||
dependencies {
|
||||
implementation "$dependency"
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<application
|
||||
android:name="io.flutter.app.FlutterApplication"
|
||||
android:label="Background Image Tester"
|
||||
android:supportsRtl="true">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
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="com.google.intent.action.TEST_LOOP" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="application/javascript" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -1,42 +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.android_background_image;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
import androidx.annotation.NonNull;
|
||||
import io.flutter.embedding.android.FlutterActivity;
|
||||
import io.flutter.embedding.engine.FlutterEngine;
|
||||
import io.flutter.plugin.common.BinaryMessenger;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
public class MainActivity extends FlutterActivity {
|
||||
@NonNull
|
||||
private final BinaryMessenger.BinaryMessageHandler finishHandler =
|
||||
new BinaryMessenger.BinaryMessageHandler() {
|
||||
@Override
|
||||
public void onMessage(ByteBuffer message, final BinaryMessenger.BinaryReply callback) {
|
||||
if (message != null) {
|
||||
// Make CI see that there is an error in the logs from Flutter.
|
||||
Log.e("flutter", "Images did not match.");
|
||||
}
|
||||
final Intent intent = new Intent(MainActivity.this, MainActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
MainActivity.this.startActivity(intent);
|
||||
MainActivity.this.finish();
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
|
||||
flutterEngine.getDartExecutor().getBinaryMessenger().setMessageHandler("finish", finishHandler);
|
||||
|
||||
final boolean moved = moveTaskToBack(true);
|
||||
if (!moved) {
|
||||
Log.e("flutter", "Failed to move to back.");
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.0.1'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = project.hasProperty('out_dir')
|
||||
? project.property('out_dir')
|
||||
: '../build'
|
||||
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
android.builder.sdkDownload=false
|
||||
@@ -1 +0,0 @@
|
||||
include ':app'
|
||||
@@ -1,59 +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.
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:typed_data';
|
||||
import 'dart:ui';
|
||||
|
||||
final Completer<bool> _completer = Completer<bool>();
|
||||
|
||||
Future<void> main() async {
|
||||
channelBuffers.setListener('flutter/lifecycle', _lifecycle);
|
||||
final bool success = await _completer.future;
|
||||
final Uint8List? message = success ? null : Uint8List.fromList(const <int>[1]);
|
||||
PlatformDispatcher.instance.sendPlatformMessage('finish', message?.buffer.asByteData(), null);
|
||||
}
|
||||
|
||||
Future<void> _lifecycle(ByteData? data, PlatformMessageResponseCallback? callback) async {
|
||||
final String lifecycleState = String.fromCharCodes(data!.buffer.asUint8List());
|
||||
if (lifecycleState == AppLifecycleState.paused.toString()) {
|
||||
await _testImage();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _testImage() async {
|
||||
// A single pixel image.
|
||||
final Uint8List pixels = Uint8List.fromList(const <int>[0, 1, 2, 3]);
|
||||
|
||||
// As long as we're using the GL backend, this will go down a path that uses
|
||||
// a cross context image.
|
||||
final Completer<Image> imageCompleter = Completer<Image>();
|
||||
decodeImageFromPixels(
|
||||
pixels,
|
||||
1,
|
||||
1,
|
||||
PixelFormat.rgba8888,
|
||||
(Image image) {
|
||||
imageCompleter.complete(image);
|
||||
},
|
||||
);
|
||||
final Image image = await imageCompleter.future;
|
||||
final PictureRecorder recorder = PictureRecorder();
|
||||
final Canvas canvas = Canvas(recorder);
|
||||
canvas.drawImage(image, Offset.zero, Paint());
|
||||
final Picture picture = recorder.endRecording();
|
||||
final Image newImage = await picture.toImage(1, 1);
|
||||
final ByteData imageData = (await newImage.toByteData())!;
|
||||
final Uint32List newPixels = imageData.buffer.asUint32List();
|
||||
|
||||
if (pixels.buffer.asUint32List()[0] != newPixels[0]) {
|
||||
print('Pixels do not match');
|
||||
print('original pixels: $pixels');
|
||||
print('new pixels: ${newPixels.buffer.asUint8List()}');
|
||||
_completer.complete(false);
|
||||
} else {
|
||||
print('Images are identical!');
|
||||
_completer.complete(true);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +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.
|
||||
|
||||
name: android_background_image
|
||||
publish_to: none
|
||||
environment:
|
||||
sdk: '>=3.2.0-0 <4.0.0'
|
||||
|
||||
# Do not add any dependencies that require more than what is provided in
|
||||
# //third_party/dart/pkg, //third_party/dart/third_party/pkg, or
|
||||
# //third_party/pkg. In particular, package:test is not usable here.
|
||||
|
||||
# If you do add packages here, make sure you can run `pub get --offline`, and
|
||||
# check the .packages and .package_config to make sure all the paths are
|
||||
# relative to this directory into //third_party/dart, or //third_party/pkg
|
||||
dependencies:
|
||||
sky_engine: any
|
||||
|
||||
dependency_overrides:
|
||||
sky_engine:
|
||||
path: ../../sky/packages/sky_engine
|
||||
@@ -22,7 +22,6 @@ ALL_PACKAGES = [
|
||||
os.path.join(ENGINE_DIR, 'flutter_frontend_server'),
|
||||
os.path.join(ENGINE_DIR, 'impeller', 'tessellator', 'dart'),
|
||||
os.path.join(ENGINE_DIR, 'shell', 'vmservice'),
|
||||
os.path.join(ENGINE_DIR, 'testing', 'android_background_image'),
|
||||
os.path.join(ENGINE_DIR, 'testing', 'benchmark'),
|
||||
os.path.join(ENGINE_DIR, 'testing', 'dart'),
|
||||
os.path.join(ENGINE_DIR, 'testing', 'litetest'),
|
||||
|
||||
Reference in New Issue
Block a user