From 69c267f0520f3c9d6ab6fb0d23fd865bfba17243 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Mon, 1 Apr 2024 10:03:14 -0700 Subject: [PATCH] Remove which does not run on CI. --- BUILD.gn | 5 -- testing/android_background_image/.gitignore | 11 ---- testing/android_background_image/BUILD.gn | 37 ----------- testing/android_background_image/README.md | 3 - .../android/.gitignore | 15 ----- .../android_background_image/android/BUILD.gn | 42 ------------- .../android/app/.gitignore | 1 - .../android/app/build.gradle | 62 ------------------- .../android/app/proguard-rules.pro | 21 ------- .../android/app/src/main/AndroidManifest.xml | 26 -------- .../MainActivity.java | 42 ------------- .../android/build.gradle | 36 ----------- .../android/gradle.properties | 4 -- .../android/settings.gradle | 1 - .../android_background_image/lib/main.dart | 59 ------------------ testing/android_background_image/pubspec.yaml | 22 ------- tools/pub_get_offline.py | 1 - 17 files changed, 388 deletions(-) delete mode 100644 testing/android_background_image/.gitignore delete mode 100644 testing/android_background_image/BUILD.gn delete mode 100644 testing/android_background_image/README.md delete mode 100644 testing/android_background_image/android/.gitignore delete mode 100644 testing/android_background_image/android/BUILD.gn delete mode 100644 testing/android_background_image/android/app/.gitignore delete mode 100644 testing/android_background_image/android/app/build.gradle delete mode 100644 testing/android_background_image/android/app/proguard-rules.pro delete mode 100644 testing/android_background_image/android/app/src/main/AndroidManifest.xml delete mode 100644 testing/android_background_image/android/app/src/main/java/dev/flutter/android_background_image/MainActivity.java delete mode 100644 testing/android_background_image/android/build.gradle delete mode 100644 testing/android_background_image/android/gradle.properties delete mode 100644 testing/android_background_image/android/settings.gradle delete mode 100644 testing/android_background_image/lib/main.dart delete mode 100644 testing/android_background_image/pubspec.yaml diff --git a/BUILD.gn b/BUILD.gn index 49784eff36e03..f21342d919a10 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -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") { diff --git a/testing/android_background_image/.gitignore b/testing/android_background_image/.gitignore deleted file mode 100644 index 7da18b117ef65..0000000000000 --- a/testing/android_background_image/.gitignore +++ /dev/null @@ -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 diff --git a/testing/android_background_image/BUILD.gn b/testing/android_background_image/BUILD.gn deleted file mode 100644 index c585ab50f80e9..0000000000000 --- a/testing/android_background_image/BUILD.gn +++ /dev/null @@ -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" ] - } -} diff --git a/testing/android_background_image/README.md b/testing/android_background_image/README.md deleted file mode 100644 index fcc6359532ef0..0000000000000 --- a/testing/android_background_image/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Android Background Image - -A test application that verifies Picture.toImage in the background on Android. diff --git a/testing/android_background_image/android/.gitignore b/testing/android_background_image/android/.gitignore deleted file mode 100644 index 88b214e75574c..0000000000000 --- a/testing/android_background_image/android/.gitignore +++ /dev/null @@ -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 diff --git a/testing/android_background_image/android/BUILD.gn b/testing/android_background_image/android/BUILD.gn deleted file mode 100644 index f9e90d1cdcd6f..0000000000000 --- a/testing/android_background_image/android/BUILD.gn +++ /dev/null @@ -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" ] -} diff --git a/testing/android_background_image/android/app/.gitignore b/testing/android_background_image/android/app/.gitignore deleted file mode 100644 index 796b96d1c4023..0000000000000 --- a/testing/android_background_image/android/app/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/testing/android_background_image/android/app/build.gradle b/testing/android_background_image/android/app/build.gradle deleted file mode 100644 index 3b064625a8a23..0000000000000 --- a/testing/android_background_image/android/app/build.gradle +++ /dev/null @@ -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" - } -} diff --git a/testing/android_background_image/android/app/proguard-rules.pro b/testing/android_background_image/android/app/proguard-rules.pro deleted file mode 100644 index f1b424510da51..0000000000000 --- a/testing/android_background_image/android/app/proguard-rules.pro +++ /dev/null @@ -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 diff --git a/testing/android_background_image/android/app/src/main/AndroidManifest.xml b/testing/android_background_image/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index a3a4f995b8227..0000000000000 --- a/testing/android_background_image/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/testing/android_background_image/android/app/src/main/java/dev/flutter/android_background_image/MainActivity.java b/testing/android_background_image/android/app/src/main/java/dev/flutter/android_background_image/MainActivity.java deleted file mode 100644 index 73001786ba308..0000000000000 --- a/testing/android_background_image/android/app/src/main/java/dev/flutter/android_background_image/MainActivity.java +++ /dev/null @@ -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(); - } - } -} diff --git a/testing/android_background_image/android/build.gradle b/testing/android_background_image/android/build.gradle deleted file mode 100644 index 5c91cb90e6a0a..0000000000000 --- a/testing/android_background_image/android/build.gradle +++ /dev/null @@ -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 -} diff --git a/testing/android_background_image/android/gradle.properties b/testing/android_background_image/android/gradle.properties deleted file mode 100644 index 06d12a7d35f42..0000000000000 --- a/testing/android_background_image/android/gradle.properties +++ /dev/null @@ -1,4 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M -android.useAndroidX=true -android.enableJetifier=true -android.builder.sdkDownload=false diff --git a/testing/android_background_image/android/settings.gradle b/testing/android_background_image/android/settings.gradle deleted file mode 100644 index e7b4def49cb53..0000000000000 --- a/testing/android_background_image/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/testing/android_background_image/lib/main.dart b/testing/android_background_image/lib/main.dart deleted file mode 100644 index 6335b51ea2c0f..0000000000000 --- a/testing/android_background_image/lib/main.dart +++ /dev/null @@ -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 _completer = Completer(); - -Future main() async { - channelBuffers.setListener('flutter/lifecycle', _lifecycle); - final bool success = await _completer.future; - final Uint8List? message = success ? null : Uint8List.fromList(const [1]); - PlatformDispatcher.instance.sendPlatformMessage('finish', message?.buffer.asByteData(), null); -} - -Future _lifecycle(ByteData? data, PlatformMessageResponseCallback? callback) async { - final String lifecycleState = String.fromCharCodes(data!.buffer.asUint8List()); - if (lifecycleState == AppLifecycleState.paused.toString()) { - await _testImage(); - } -} - -Future _testImage() async { - // A single pixel image. - final Uint8List pixels = Uint8List.fromList(const [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 imageCompleter = Completer(); - 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); - } -} diff --git a/testing/android_background_image/pubspec.yaml b/testing/android_background_image/pubspec.yaml deleted file mode 100644 index ff08f39de0489..0000000000000 --- a/testing/android_background_image/pubspec.yaml +++ /dev/null @@ -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 diff --git a/tools/pub_get_offline.py b/tools/pub_get_offline.py index a5b70a1ba9fa9..11b6bdf2eec8d 100644 --- a/tools/pub_get_offline.py +++ b/tools/pub_get_offline.py @@ -22,7 +22,6 @@ 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'),