diff --git a/dev/devicelab/bin/tasks/complex_layout_semantics_perf.dart b/dev/devicelab/bin/tasks/complex_layout_semantics_perf.dart index bb5b6606b3..ab1d4b7c12 100644 --- a/dev/devicelab/bin/tasks/complex_layout_semantics_perf.dart +++ b/dev/devicelab/bin/tasks/complex_layout_semantics_perf.dart @@ -32,7 +32,6 @@ void main() { '-d', deviceId, ]); - await device.uninstallApp(); }); final String outputPath = Platform.environment['FLUTTER_TEST_OUTPUTS_DIR'] ?? p.join(complexLayoutPath, 'build'); diff --git a/dev/devicelab/bin/tasks/drive_perf_debug_warning.dart b/dev/devicelab/bin/tasks/drive_perf_debug_warning.dart index d67abb9216..0390ad891e 100644 --- a/dev/devicelab/bin/tasks/drive_perf_debug_warning.dart +++ b/dev/devicelab/bin/tasks/drive_perf_debug_warning.dart @@ -16,7 +16,6 @@ Future _runWithMode(String mode, String deviceId) async { '-d', deviceId, ]); - await evalFlutter('install', options: ['--uninstall-only', '-d', deviceId]); return stderr.toString(); } diff --git a/dev/devicelab/bin/tasks/hello_world__memory.dart b/dev/devicelab/bin/tasks/hello_world__memory.dart index c8869060b9..60fa3e1a08 100644 --- a/dev/devicelab/bin/tasks/hello_world__memory.dart +++ b/dev/devicelab/bin/tasks/hello_world__memory.dart @@ -29,7 +29,6 @@ class HelloWorldMemoryTest extends MemoryTest { await recordStart(); await Future.delayed(const Duration(milliseconds: 3000)); await recordEnd(); - await device!.uninstallApp(); } } diff --git a/dev/devicelab/bin/tasks/hello_world_impeller.dart b/dev/devicelab/bin/tasks/hello_world_impeller.dart index 22bdd8bdef..e67a25b48e 100644 --- a/dev/devicelab/bin/tasks/hello_world_impeller.dart +++ b/dev/devicelab/bin/tasks/hello_world_impeller.dart @@ -65,7 +65,6 @@ Future run() async { await Future.delayed(const Duration(seconds: 30)); process.stdin.write('q'); await adb.cancel(); - await device.uninstallApp(); }); if (!isUsingValidationLayers || impellerBackendCount != 1) { diff --git a/dev/devicelab/bin/tasks/platform_channels_benchmarks.dart b/dev/devicelab/bin/tasks/platform_channels_benchmarks.dart index 3547a1ca82..99d8dd9be1 100644 --- a/dev/devicelab/bin/tasks/platform_channels_benchmarks.dart +++ b/dev/devicelab/bin/tasks/platform_channels_benchmarks.dart @@ -7,5 +7,6 @@ import 'package:flutter_devicelab/framework/framework.dart' show task; import 'package:flutter_devicelab/tasks/platform_channels_benchmarks.dart' as platform_channels_benchmarks; Future main() async { - await task(platform_channels_benchmarks.runTask(DeviceOperatingSystem.android)); + await task( + platform_channels_benchmarks.runTask(DeviceOperatingSystem.android)); } diff --git a/dev/devicelab/bin/tasks/route_test_ios.dart b/dev/devicelab/bin/tasks/route_test_ios.dart index a2ac3081a4..4ba3b42fc1 100644 --- a/dev/devicelab/bin/tasks/route_test_ios.dart +++ b/dev/devicelab/bin/tasks/route_test_ios.dart @@ -16,9 +16,9 @@ void main() { final Device device = await devices.workingDevice; await device.unlock(); final Directory appDir = dir(path.join(flutterDirectory.path, 'dev/integration_tests/ui')); - section('TEST WHETHER `flutter drive --route` WORKS ON iOS'); + section('TEST WHETHER `flutter drive --route` WORKS on IOS'); await inDirectory(appDir, () async { - await flutter( + return flutter( 'drive', options: [ '--verbose', @@ -29,7 +29,6 @@ void main() { 'lib/route.dart', ], ); - await device.uninstallApp(); }); return TaskResult.success(null); }); diff --git a/dev/devicelab/bin/tasks/service_extensions_test.dart b/dev/devicelab/bin/tasks/service_extensions_test.dart index f1ebc10bb4..1ca335774a 100644 --- a/dev/devicelab/bin/tasks/service_extensions_test.dart +++ b/dev/devicelab/bin/tasks/service_extensions_test.dart @@ -118,7 +118,6 @@ void main() { if (result != 0) { throw 'Received unexpected exit code $result from run process.'; } - await device.uninstallApp(); }); return TaskResult.success(null); }); diff --git a/dev/devicelab/lib/tasks/android_choreographer_do_frame_test.dart b/dev/devicelab/lib/tasks/android_choreographer_do_frame_test.dart index 50b1a6d683..59eb41da31 100644 --- a/dev/devicelab/lib/tasks/android_choreographer_do_frame_test.dart +++ b/dev/devicelab/lib/tasks/android_choreographer_do_frame_test.dart @@ -161,13 +161,6 @@ Future main() async { await stderr.cancel(); run.kill(); - await inDirectory(path.join(tempDir.path, 'app'), () async { - await flutter( - 'install', - options: ['--uninstall-only'], - ); - }); - if (nextCompleterIdx == sentinelCompleters.values.length) { return TaskResult.success(null); } diff --git a/dev/devicelab/lib/tasks/android_lifecycles_test.dart b/dev/devicelab/lib/tasks/android_lifecycles_test.dart index 907c4774d9..38c74595a8 100644 --- a/dev/devicelab/lib/tasks/android_lifecycles_test.dart +++ b/dev/devicelab/lib/tasks/android_lifecycles_test.dart @@ -154,13 +154,6 @@ void main() { await lifecycles.close(); await stdout.cancel(); await stderr.cancel(); - - await inDirectory(path.join(tempDir.path, 'app'), () async { - await flutter( - 'install', - options: ['--uninstall-only'], - ); - }); return TaskResult.success(null); } diff --git a/dev/devicelab/lib/tasks/android_verified_input_test.dart b/dev/devicelab/lib/tasks/android_verified_input_test.dart index eb492c9628..ec084110a5 100644 --- a/dev/devicelab/lib/tasks/android_verified_input_test.dart +++ b/dev/devicelab/lib/tasks/android_verified_input_test.dart @@ -53,7 +53,7 @@ class DriverTest { ...extraOptions, ]; await flutter('drive', options: options, environment: environment); - await flutter('install', options: ['--uninstall-only', '-d', deviceId], environment: environment); + return TaskResult.success(null); }); } diff --git a/dev/devicelab/lib/tasks/android_views_test.dart b/dev/devicelab/lib/tasks/android_views_test.dart index c77b5b8b66..8900f2c411 100644 --- a/dev/devicelab/lib/tasks/android_views_test.dart +++ b/dev/devicelab/lib/tasks/android_views_test.dart @@ -34,7 +34,8 @@ TaskFunction androidViewsTest({ final int exitCode = await exec( './gradlew', ['-q', 'dependencies'], - workingDirectory: '${flutterDirectory.path}/dev/integration_tests/android_views/android' + workingDirectory: + '${flutterDirectory.path}/dev/integration_tests/android_views/android' ); if (exitCode != 0) { return TaskResult.failure('Failed to download gradle dependencies'); @@ -50,12 +51,6 @@ TaskFunction androidViewsTest({ environment: environment, workingDirectory: '${flutterDirectory.path}/dev/integration_tests/android_views' ); - await flutter( - 'install', - options: ['--uninstall-only'], - environment: environment, - workingDirectory: '${flutterDirectory.path}/dev/integration_tests/android_views', - ); return TaskResult.success(null); }; } diff --git a/dev/devicelab/lib/tasks/build_test_task.dart b/dev/devicelab/lib/tasks/build_test_task.dart index 80472422c6..2405763fd1 100644 --- a/dev/devicelab/lib/tasks/build_test_task.dart +++ b/dev/devicelab/lib/tasks/build_test_task.dart @@ -61,6 +61,7 @@ abstract class BuildTestTask { await flutter('build', options: getBuildArgs(deviceOperatingSystem)); copyArtifacts(); }); + } /// Run Flutter drive test from [getTestArgs] against the application under test on the device. @@ -72,8 +73,8 @@ abstract class BuildTestTask { await inDirectory(workingDirectory, () async { section('DRIVE START'); await flutter('drive', options: getTestArgs(deviceOperatingSystem, device.deviceId)); - await device.uninstallApp(); }); + return parseTaskResult(); } diff --git a/dev/devicelab/lib/tasks/dart_plugin_registry_tests.dart b/dev/devicelab/lib/tasks/dart_plugin_registry_tests.dart index bc3c620cd7..794dfde700 100644 --- a/dev/devicelab/lib/tasks/dart_plugin_registry_tests.dart +++ b/dev/devicelab/lib/tasks/dart_plugin_registry_tests.dart @@ -65,13 +65,12 @@ class ApluginPlatformInterfaceMacOS { pluginImplPubspecContent = pluginImplPubspecContent.replaceFirst( ' pluginClass: ApluginPlatformImplementationPlugin', ' pluginClass: ApluginPlatformImplementationPlugin\n' - ' dartPluginClass: ApluginPlatformInterfaceMacOS\n', + ' dartPluginClass: ApluginPlatformInterfaceMacOS\n', ); pluginImplPubspecContent = pluginImplPubspecContent.replaceFirst( ' platforms:\n', ' implements: aplugin_platform_interface\n' - ' platforms:\n', - ); + ' platforms:\n'); await pluginImplPubspec.writeAsString(pluginImplPubspecContent, flush: true); @@ -105,8 +104,8 @@ class ApluginPlatformInterfaceMacOS { pluginInterfacePubspecContent.replaceFirst( 'dependencies:', 'dependencies:\n' - ' aplugin_platform_implementation:\n' - ' path: ../aplugin_platform_implementation\n'); + ' aplugin_platform_implementation:\n' + ' path: ../aplugin_platform_implementation\n'); await pluginInterfacePubspec.writeAsString(pluginInterfacePubspecContent, flush: true); @@ -136,8 +135,8 @@ class ApluginPlatformInterfaceMacOS { appPubspecContent = appPubspecContent.replaceFirst( 'dependencies:', 'dependencies:\n' - ' aplugin_platform_interface:\n' - ' path: ../aplugin_platform_interface\n'); + ' aplugin_platform_interface:\n' + ' path: ../aplugin_platform_interface\n'); await appPubspec.writeAsString(appPubspecContent, flush: true); section('Flutter run for macos'); @@ -208,11 +207,6 @@ class ApluginPlatformInterfaceMacOS { unawaited(stdoutSub.cancel()); unawaited(stderrSub.cancel()); - await flutter( - 'install', - options: ['--uninstall-only', '-d', 'macos'], - ); - return TaskResult.success(null); } finally { rmTree(tempDir); diff --git a/dev/devicelab/lib/tasks/entrypoint_dart_registrant.dart b/dev/devicelab/lib/tasks/entrypoint_dart_registrant.dart index 9ca207e1f1..d9a1f3ea8c 100644 --- a/dev/devicelab/lib/tasks/entrypoint_dart_registrant.dart +++ b/dev/devicelab/lib/tasks/entrypoint_dart_registrant.dart @@ -82,7 +82,6 @@ Future _runWithTempDir(Directory tempDir) async { process.stdin.write('q'); await process.stdin.flush(); process.kill(ProcessSignal.sigint); - await device.uninstallApp(); return entrypoint; }); if (entrypoint.contains('$_messagePrefix $_entrypointName')) { diff --git a/dev/devicelab/lib/tasks/gallery.dart b/dev/devicelab/lib/tasks/gallery.dart index 0bfd4dc9d2..f9ae9a058c 100644 --- a/dev/devicelab/lib/tasks/gallery.dart +++ b/dev/devicelab/lib/tasks/gallery.dart @@ -80,6 +80,7 @@ TaskFunction createGalleryTransitionHybridTest({bool semanticsEnabled = false}) } class GalleryTransitionTest { + GalleryTransitionTest({ this.semanticsEnabled = false, this.testFile = 'transitions_perf', @@ -153,7 +154,6 @@ class GalleryTransitionTest { '-v', '--verbose-system-logs' ]); - await flutter('install', options: ['--uninstall-only', '-d', deviceId]); }); final String testOutputDirectory = Platform.environment['FLUTTER_TEST_OUTPUTS_DIR'] ?? '${galleryDirectory.path}/build'; @@ -384,11 +384,11 @@ class GalleryTransitionBuildTest extends BuildTestTask { String getApplicationBinaryPath() { if (deviceOperatingSystem == DeviceOperatingSystem.android) { return '$applicationBinaryPath/app-profile.apk'; - } - if (deviceOperatingSystem == DeviceOperatingSystem.ios) { + } else if (deviceOperatingSystem == DeviceOperatingSystem.ios) { return '$applicationBinaryPath/Flutter Gallery.app'; + } else { + return applicationBinaryPath!; } - return applicationBinaryPath!; } } diff --git a/dev/devicelab/lib/tasks/hot_mode_tests.dart b/dev/devicelab/lib/tasks/hot_mode_tests.dart index 1430050c11..003b7e88ce 100644 --- a/dev/devicelab/lib/tasks/hot_mode_tests.dart +++ b/dev/devicelab/lib/tasks/hot_mode_tests.dart @@ -168,8 +168,6 @@ TaskFunction createHotModeTest({ >[stdoutDone.future, stderrDone.future]); await process.exitCode; - await flutter('install', options: ['--uninstall-only', '-d', deviceIdOverride!]); - freshRestartReloadsData = json.decode(benchmarkFile.readAsStringSync()) as Map; } diff --git a/dev/devicelab/lib/tasks/integration_tests.dart b/dev/devicelab/lib/tasks/integration_tests.dart index 06df01e034..17f5d3d9df 100644 --- a/dev/devicelab/lib/tasks/integration_tests.dart +++ b/dev/devicelab/lib/tasks/integration_tests.dart @@ -208,7 +208,7 @@ class DriverTest { ...extraOptions, ]; await flutter('drive', options: options, environment: environment); - await flutter('install', options: ['--uninstall-only', '-d', deviceId], environment: environment); + return TaskResult.success(null); }); } @@ -267,7 +267,6 @@ class IntegrationTest { if (withTalkBack) { await disableTalkBack(); } - await flutter('install', options: ['--uninstall-only', '-d', deviceId], environment: environment); return TaskResult.success(null); }); diff --git a/dev/devicelab/lib/tasks/microbenchmarks.dart b/dev/devicelab/lib/tasks/microbenchmarks.dart index 9061bd5d43..aa38ab9a57 100644 --- a/dev/devicelab/lib/tasks/microbenchmarks.dart +++ b/dev/devicelab/lib/tasks/microbenchmarks.dart @@ -47,9 +47,7 @@ TaskFunction createMicrobenchmarkTask({ environment: environment, ); }); - final Future> result = readJsonResults(flutterProcess); - await device.uninstallApp(); - return result; + return readJsonResults(flutterProcess); } return run(); diff --git a/dev/devicelab/lib/tasks/native_assets_test.dart b/dev/devicelab/lib/tasks/native_assets_test.dart index 8e54708696..d6ee607420 100644 --- a/dev/devicelab/lib/tasks/native_assets_test.dart +++ b/dev/devicelab/lib/tasks/native_assets_test.dart @@ -99,7 +99,6 @@ TaskFunction createNativeAssetsTest({ if (runFlutterResult != 0) { print('Flutter run returned non-zero exit code: $runFlutterResult.'); } - await flutter('install', options: ['--uninstall-only', '-d', deviceIdOverride!]); }); final int expectedNumberOfTransitions = buildMode == 'debug' ? 4 : 1; diff --git a/dev/devicelab/lib/tasks/perf_tests.dart b/dev/devicelab/lib/tasks/perf_tests.dart index 19f3a90b3f..c6d1a2e22a 100644 --- a/dev/devicelab/lib/tasks/perf_tests.dart +++ b/dev/devicelab/lib/tasks/perf_tests.dart @@ -1245,10 +1245,9 @@ class PerfTest { /// If null, the device is selected depending on the current environment. final Device? device; - /// The function called instead of the actual `flutter drive`. + /// The function called instead of the actually `flutter drive`. /// - /// If it is not `null`, `flutter drive` and `flutter install --uninstall-only` - /// will not happen in the PerfTests. + /// If it is not `null`, `flutter drive` will not happen in the PerfTests. final FlutterDriveCallback? flutterDriveCallback; /// Whether the perf test should enable Impeller. @@ -1261,8 +1260,6 @@ class PerfTest { final bool disablePartialRepaint; /// Number of seconds to time out the test after, allowing debug callbacks to run. - /// - /// Passed to `--timeout`. final int? timeoutSeconds; /// The keys of the values that need to be reported. @@ -1396,7 +1393,6 @@ class PerfTest { flutterDriveCallback!(options); } else { await flutter('drive', options: options); - await flutter('install', options: ['--uninstall-only', '-d', deviceId]); } } finally { await resetManifest(); @@ -2131,8 +2127,6 @@ class DevToolsMemoryTest { } } - await _device.uninstallApp(); - return TaskResult.success( {'maxRss': maxRss, 'maxAdbTotal': maxAdbTotal}, benchmarkScoreKeys: ['maxRss', 'maxAdbTotal'], @@ -2205,12 +2199,13 @@ class ReportedDurationTest { await device!.stop(package); await adb.cancel(); - await device!.uninstallApp(); _device = null; final Map reportedDuration = { 'duration': duration, }; + _device = null; + return TaskResult.success(reportedDuration, benchmarkScoreKeys: reportedDuration.keys.toList()); }); } diff --git a/dev/devicelab/lib/tasks/platform_channels_benchmarks.dart b/dev/devicelab/lib/tasks/platform_channels_benchmarks.dart index 31620f2bd9..fcb579c04c 100644 --- a/dev/devicelab/lib/tasks/platform_channels_benchmarks.dart +++ b/dev/devicelab/lib/tasks/platform_channels_benchmarks.dart @@ -20,7 +20,7 @@ TaskFunction runTask(adb.DeviceOperatingSystem operatingSystem) { final Directory appDir = utils.dir(path.join(utils.flutterDirectory.path, 'dev/benchmarks/platform_channels_benchmarks')); - return utils.inDirectory(appDir, () async { + final Process flutterProcess = await utils.inDirectory(appDir, () async { final List createArgs = [ '--platforms', 'ios,android', @@ -39,13 +39,15 @@ TaskFunction runTask(adb.DeviceOperatingSystem operatingSystem) { '-d', device.deviceId, ]; - final Process flutterProcess = await utils.startFlutter( + return utils.startFlutter( 'run', options: options, ); - final Map results = await microbenchmarks.readJsonResults(flutterProcess); - await device.uninstallApp(); - return TaskResult.success(results, benchmarkScoreKeys: results.keys.toList()); }); + + final Map results = + await microbenchmarks.readJsonResults(flutterProcess); + return TaskResult.success(results, + benchmarkScoreKeys: results.keys.toList()); }; } diff --git a/dev/devicelab/lib/tasks/run_tests.dart b/dev/devicelab/lib/tasks/run_tests.dart index f553eeffdd..33651ae867 100644 --- a/dev/devicelab/lib/tasks/run_tests.dart +++ b/dev/devicelab/lib/tasks/run_tests.dart @@ -109,7 +109,7 @@ class AndroidRunOutputTest extends RunOutputTask { @override bool isExpectedStderr(String line) { - // TODO(egarciad): Remove (because https://github.com/flutter/flutter/issues/95131 is now fixed) + // TODO(egarciad): Remove once https://github.com/flutter/flutter/issues/95131 is fixed. return line.contains('Mapping new ns'); } @@ -321,8 +321,6 @@ abstract class RunOutputTask { await run.exitCode; - await device.uninstallApp(); - if (stderr.isNotEmpty) { throw 'flutter run ${release ? '--release' : ''} had unexpected output on standard error.'; } diff --git a/dev/devicelab/lib/tasks/web_dev_mode_tests.dart b/dev/devicelab/lib/tasks/web_dev_mode_tests.dart index f243d4fc27..fde8eb48ef 100644 --- a/dev/devicelab/lib/tasks/web_dev_mode_tests.dart +++ b/dev/devicelab/lib/tasks/web_dev_mode_tests.dart @@ -125,6 +125,7 @@ TaskFunction createWebDevModeTest(String webDevice, bool enableIncrementalCompil // Start `flutter run` again to make sure it loads from the previous // state. dev compilers loads up from previously compiled JavaScript. { + final Stopwatch sw = Stopwatch()..start(); final Process process = await startFlutter( 'run',