Unverified Commit c81c78f8 authored by Emmanuel Garcia's avatar Emmanuel Garcia Committed by GitHub

Test that flutter assets are contained in the APK (#41254)

parent 778add83
...@@ -100,6 +100,7 @@ Future<void> main() async { ...@@ -100,6 +100,7 @@ Future<void> main() async {
final Iterable<String> demoDebugFiles = await getFilesInApk(demoDebugApk); final Iterable<String> demoDebugFiles = await getFilesInApk(demoDebugApk);
checkItContains<String>(<String>[ checkItContains<String>(<String>[
...flutterAssets,
'assets/flutter_assets/isolate_snapshot_data', 'assets/flutter_assets/isolate_snapshot_data',
'assets/flutter_assets/kernel_blob.bin', 'assets/flutter_assets/kernel_blob.bin',
'assets/flutter_assets/vm_snapshot_data', 'assets/flutter_assets/vm_snapshot_data',
...@@ -149,6 +150,7 @@ Future<void> main() async { ...@@ -149,6 +150,7 @@ Future<void> main() async {
final Iterable<String> demoStagingFiles = await getFilesInApk(demoStagingApk); final Iterable<String> demoStagingFiles = await getFilesInApk(demoStagingApk);
checkItContains<String>(<String>[ checkItContains<String>(<String>[
...flutterAssets,
'assets/flutter_assets/isolate_snapshot_data', 'assets/flutter_assets/isolate_snapshot_data',
'assets/flutter_assets/kernel_blob.bin', 'assets/flutter_assets/kernel_blob.bin',
'assets/flutter_assets/vm_snapshot_data', 'assets/flutter_assets/vm_snapshot_data',
...@@ -200,6 +202,7 @@ Future<void> main() async { ...@@ -200,6 +202,7 @@ Future<void> main() async {
final Iterable<String> demoReleaseFiles = await getFilesInApk(demoReleaseApk); final Iterable<String> demoReleaseFiles = await getFilesInApk(demoReleaseApk);
checkItContains<String>(<String>[ checkItContains<String>(<String>[
...flutterAssets,
'lib/arm64-v8a/libapp.so', 'lib/arm64-v8a/libapp.so',
'lib/arm64-v8a/libflutter.so', 'lib/arm64-v8a/libflutter.so',
'lib/armeabi-v7a/libapp.so', 'lib/armeabi-v7a/libapp.so',
...@@ -250,6 +253,7 @@ Future<void> main() async { ...@@ -250,6 +253,7 @@ Future<void> main() async {
final Iterable<String> demoProdFiles = await getFilesInApk(demoProdApk); final Iterable<String> demoProdFiles = await getFilesInApk(demoProdApk);
checkItContains<String>(<String>[ checkItContains<String>(<String>[
...flutterAssets,
'lib/arm64-v8a/libapp.so', 'lib/arm64-v8a/libapp.so',
'lib/arm64-v8a/libflutter.so', 'lib/arm64-v8a/libflutter.so',
'lib/armeabi-v7a/libapp.so', 'lib/armeabi-v7a/libapp.so',
......
...@@ -190,6 +190,7 @@ Future<void> main() async { ...@@ -190,6 +190,7 @@ Future<void> main() async {
section('Check files in debug APK'); section('Check files in debug APK');
checkItContains<String>(<String>[ checkItContains<String>(<String>[
...flutterAssets,
'AndroidManifest.xml', 'AndroidManifest.xml',
'assets/flutter_assets/isolate_snapshot_data', 'assets/flutter_assets/isolate_snapshot_data',
'assets/flutter_assets/kernel_blob.bin', 'assets/flutter_assets/kernel_blob.bin',
...@@ -246,6 +247,7 @@ Future<void> main() async { ...@@ -246,6 +247,7 @@ Future<void> main() async {
section('Check files in release APK'); section('Check files in release APK');
checkItContains<String>(<String>[ checkItContains<String>(<String>[
...flutterAssets,
'AndroidManifest.xml', 'AndroidManifest.xml',
'lib/arm64-v8a/libapp.so', 'lib/arm64-v8a/libapp.so',
'lib/arm64-v8a/libflutter.so', 'lib/arm64-v8a/libflutter.so',
......
...@@ -10,6 +10,13 @@ import 'package:path/path.dart' as path; ...@@ -10,6 +10,13 @@ import 'package:path/path.dart' as path;
import 'package:flutter_devicelab/framework/framework.dart'; import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/framework/utils.dart'; import 'package:flutter_devicelab/framework/utils.dart';
final List<String> flutterAssets = <String>[
'assets/flutter_assets/AssetManifest.json',
'assets/flutter_assets/LICENSE',
'assets/flutter_assets/fonts/MaterialIcons-Regular.ttf',
'assets/flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf',
];
/// Runs the given [testFunction] on a freshly generated Flutter project. /// Runs the given [testFunction] on a freshly generated Flutter project.
Future<void> runProjectTest(Future<void> testFunction(FlutterProject project)) async { Future<void> runProjectTest(Future<void> testFunction(FlutterProject project)) async {
final Directory tempDir = Directory.systemTemp.createTempSync('flutter_devicelab_gradle_plugin_test.'); final Directory tempDir = Directory.systemTemp.createTempSync('flutter_devicelab_gradle_plugin_test.');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment