mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Enable unnecessary_await_in_return lint (#77434)
This commit is contained in:
parent
8a9042ba91
commit
cb867bbedc
@ -173,7 +173,7 @@ linter:
|
||||
- prefer_iterable_whereType
|
||||
# - prefer_mixin # https://github.com/dart-lang/language/issues/32
|
||||
- prefer_null_aware_operators
|
||||
# - prefer_relative_imports # not yet tested
|
||||
# - prefer_relative_imports # incompatible with sub-package imports
|
||||
- prefer_single_quotes
|
||||
- prefer_spread_collections
|
||||
- prefer_typing_uninitialized_variables
|
||||
@ -193,7 +193,7 @@ linter:
|
||||
# - type_annotate_public_apis # subset of always_specify_types
|
||||
- type_init_formals
|
||||
# - unawaited_futures # too many false positives
|
||||
# - unnecessary_await_in_return # not yet tested
|
||||
- unnecessary_await_in_return
|
||||
- unnecessary_brace_in_string_interps
|
||||
- unnecessary_const
|
||||
# - unnecessary_final # conflicts with prefer_final_locals
|
||||
|
@ -1203,7 +1203,7 @@ Future<EvalResult> _evalCommand(String executable, List<String> arguments, {
|
||||
Future<void> _runFlutterAnalyze(String workingDirectory, {
|
||||
List<String> options = const <String>[],
|
||||
}) async {
|
||||
return await runCommand(
|
||||
return runCommand(
|
||||
flutter,
|
||||
<String>['analyze', '--dartdocs', ...options],
|
||||
workingDirectory: workingDirectory,
|
||||
@ -1214,7 +1214,7 @@ final RegExp _importPattern = RegExp(r'''^\s*import (['"])package:flutter/([^.]+
|
||||
final RegExp _importMetaPattern = RegExp(r'''^\s*import (['"])package:meta/meta\.dart\1''');
|
||||
|
||||
Future<Set<String>> _findFlutterDependencies(String srcPath, List<String> errors, { bool checkForMeta = false }) async {
|
||||
return await _allFiles(srcPath, 'dart', minimumMatches: 1)
|
||||
return _allFiles(srcPath, 'dart', minimumMatches: 1)
|
||||
.map<Set<String>>((File file) {
|
||||
final Set<String> result = <String>{};
|
||||
for (final String line in file.readAsLinesSync()) {
|
||||
|
@ -669,7 +669,7 @@ class ArchivePublisher {
|
||||
if (dest.endsWith('.json')) {
|
||||
mimeType = 'application/json';
|
||||
}
|
||||
return await _runGsUtil(<String>[
|
||||
return _runGsUtil(<String>[
|
||||
// Use our preferred MIME type for the files we care about
|
||||
// and let gsutil figure it out for anything else.
|
||||
if (mimeType != null) ...<String>['-h', 'Content-Type:$mimeType'],
|
||||
|
@ -377,7 +377,7 @@ void main() {
|
||||
'$gsutilCall -- stat $gsArchivePath': <ProcessResult>[ProcessResult(0, 0, '', '')],
|
||||
};
|
||||
processManager.fakeResults = calls;
|
||||
expect(() async => await publisher.publishArchive(false), throwsException);
|
||||
expect(() async => publisher.publishArchive(false), throwsException);
|
||||
processManager.verifyCalls(calls.keys.toList());
|
||||
});
|
||||
|
||||
|
@ -383,7 +383,7 @@ class ArchiveUnpublisher {
|
||||
if (mimeType != null) ...<String>['-h', 'Content-Type:$mimeType'],
|
||||
...<String>['cp', src, dest],
|
||||
];
|
||||
return await _runGsUtil(args, confirm: confirmed);
|
||||
return _runGsUtil(args, confirm: confirmed);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class NewGalleryWebCompileTest {
|
||||
() async {
|
||||
await flutter('doctor');
|
||||
|
||||
return await WebCompileTest.runSingleBuildTest(
|
||||
return WebCompileTest.runSingleBuildTest(
|
||||
directory: galleryDir.path,
|
||||
metric: metricKeyPrefix,
|
||||
measureBuildTime: true,
|
||||
|
@ -33,6 +33,6 @@ Future<void> main() async {
|
||||
});
|
||||
|
||||
final TaskFunction taskFunction = createPlatformViewStartupTest();
|
||||
return await taskFunction();
|
||||
return taskFunction();
|
||||
});
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ void main() {
|
||||
final Directory appDir = dir(path.join(flutterDirectory.path, 'dev/integration_tests/ui'));
|
||||
section('TEST WHETHER `flutter drive --route` WORKS');
|
||||
await inDirectory(appDir, () async {
|
||||
return await flutter(
|
||||
return flutter(
|
||||
'drive',
|
||||
options: <String>['--verbose', '-d', device.deviceId, '--route', '/smuggle-it', 'lib/route.dart'],
|
||||
canFail: false,
|
||||
|
@ -8,6 +8,6 @@ import 'package:flutter_devicelab/tasks/web_benchmarks.dart';
|
||||
/// Runs all Web benchmarks using the CanvasKit rendering backend.
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
return await runWebBenchmark(useCanvasKit: true);
|
||||
return runWebBenchmark(useCanvasKit: true);
|
||||
});
|
||||
}
|
||||
|
@ -8,6 +8,6 @@ import 'package:flutter_devicelab/tasks/web_benchmarks.dart';
|
||||
/// Runs all Web benchmarks using the HTML rendering backend.
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
return await runWebBenchmark(useCanvasKit: false);
|
||||
return runWebBenchmark(useCanvasKit: false);
|
||||
});
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ class ApkExtractor {
|
||||
|
||||
/// Gets the content of the `AndroidManifest.xml`.
|
||||
Future<String> getAndroidManifest(String apk) async {
|
||||
return await _evalApkAnalyzer(
|
||||
return _evalApkAnalyzer(
|
||||
<String>[
|
||||
'manifest',
|
||||
'print',
|
||||
|
@ -750,7 +750,7 @@ Future<int> gitClone({String path, String repo}) async {
|
||||
|
||||
await Directory(path).create(recursive: true);
|
||||
|
||||
return await inDirectory<int>(
|
||||
return inDirectory<int>(
|
||||
path,
|
||||
() => exec('git', <String>['clone', repo]),
|
||||
);
|
||||
|
@ -35,13 +35,13 @@ TaskFunction createMicrobenchmarkTask() {
|
||||
device.deviceId,
|
||||
];
|
||||
options.add(benchmarkPath);
|
||||
return await _startFlutter(
|
||||
return _startFlutter(
|
||||
options: options,
|
||||
canFail: false,
|
||||
);
|
||||
});
|
||||
|
||||
return await _readJsonResults(flutterProcess);
|
||||
return _readJsonResults(flutterProcess);
|
||||
}
|
||||
return _run();
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ class NewGalleryPerfTest extends PerfTest {
|
||||
// turns out to be updated frequently in the future, we can set up an auto
|
||||
// roller to update this version.
|
||||
await getNewGallery(galleryVersion, galleryDir);
|
||||
return await super.run();
|
||||
return super.run();
|
||||
}
|
||||
|
||||
final Directory galleryDir;
|
||||
|
@ -486,7 +486,7 @@ class StartupTest {
|
||||
final bool reportMetrics;
|
||||
|
||||
Future<TaskResult> run() async {
|
||||
return await inDirectory<TaskResult>(testDirectory, () async {
|
||||
return inDirectory<TaskResult>(testDirectory, () async {
|
||||
final Device device = await devices.workingDevice;
|
||||
const int iterations = 5;
|
||||
final List<Map<String, dynamic>> results = <Map<String, dynamic>>[];
|
||||
@ -995,7 +995,7 @@ class CompileTest {
|
||||
final bool reportPackageContentSizes;
|
||||
|
||||
Future<TaskResult> run() async {
|
||||
return await inDirectory<TaskResult>(testDirectory, () async {
|
||||
return inDirectory<TaskResult>(testDirectory, () async {
|
||||
final Device device = await devices.workingDevice;
|
||||
await device.unlock();
|
||||
await flutter('packages', options: <String>['get']);
|
||||
|
@ -25,7 +25,7 @@ Future<TaskResult> runWebBenchmark({ @required bool useCanvasKit }) async {
|
||||
// Reduce logging level. Otherwise, package:webkit_inspection_protocol is way too spammy.
|
||||
Logger.root.level = Level.INFO;
|
||||
final String macrobenchmarksDirectory = path.join(flutterDirectory.path, 'dev', 'benchmarks', 'macrobenchmarks');
|
||||
return await inDirectory(macrobenchmarksDirectory, () async {
|
||||
return inDirectory(macrobenchmarksDirectory, () async {
|
||||
await evalFlutter('build', options: <String>[
|
||||
'web',
|
||||
'--dart-define=FLUTTER_WEB_ENABLE_PROFILING=true',
|
||||
|
@ -116,7 +116,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
final TextStyle dialogTextStyle = theme.textTheme.subtitle1!.copyWith(color: theme.textTheme.caption!.color);
|
||||
|
||||
return await (showDialog<bool>(
|
||||
return showDialog<bool>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
@ -140,7 +140,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
||||
],
|
||||
);
|
||||
},
|
||||
) as Future<bool>);
|
||||
) as Future<bool>;
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -143,7 +143,7 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
|
||||
if (form == null || !_formWasEdited || form.validate())
|
||||
return true;
|
||||
|
||||
return await (showDialog<bool>(
|
||||
return showDialog<bool>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
@ -161,7 +161,7 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
|
||||
],
|
||||
);
|
||||
},
|
||||
) as Future<bool>);
|
||||
) as Future<bool>;
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -38,7 +38,7 @@ Future<String> getAndroidKeyCodes() async {
|
||||
|
||||
Future<String> getWindowsKeyCodes() async {
|
||||
final Uri keyCodesUri = Uri.parse('https://raw.githubusercontent.com/tpn/winsdk-10/master/Include/10.0.10240.0/um/WinUser.h');
|
||||
return await http.read(keyCodesUri);
|
||||
return http.read(keyCodesUri);
|
||||
}
|
||||
|
||||
/// Get contents of the file that contains the scan codes in Android source.
|
||||
@ -54,12 +54,12 @@ Future<String> getAndroidScanCodes() async {
|
||||
|
||||
Future<String> getGlfwKeyCodes() async {
|
||||
final Uri keyCodesUri = Uri.parse('https://raw.githubusercontent.com/glfw/glfw/master/include/GLFW/glfw3.h');
|
||||
return await http.read(keyCodesUri);
|
||||
return http.read(keyCodesUri);
|
||||
}
|
||||
|
||||
Future<String> getGtkKeyCodes() async {
|
||||
final Uri keyCodesUri = Uri.parse('https://gitlab.gnome.org/GNOME/gtk/-/raw/master/gdk/gdkkeysyms.h');
|
||||
return await http.read(keyCodesUri);
|
||||
return http.read(keyCodesUri);
|
||||
}
|
||||
|
||||
Future<void> main(List<String> rawArguments) async {
|
||||
|
@ -69,7 +69,7 @@ void main() {
|
||||
test('throws exception if not run from macos', () async {
|
||||
createRunner(operatingSystem: 'linux');
|
||||
expect(
|
||||
() async => await runner.run(<String>['codesign']),
|
||||
() async => runner.run(<String>['codesign']),
|
||||
throwsExceptionWith('Error! Expected operating system "macos"'),
|
||||
);
|
||||
});
|
||||
@ -77,7 +77,7 @@ void main() {
|
||||
test('throws exception if verify flag is not provided', () async {
|
||||
createRunner();
|
||||
expect(
|
||||
() async => await runner.run(<String>['codesign']),
|
||||
() async => runner.run(<String>['codesign']),
|
||||
throwsExceptionWith(
|
||||
'Sorry, but codesigning is not implemented yet. Please pass the --$kVerify flag to verify signatures'),
|
||||
);
|
||||
@ -240,7 +240,7 @@ void main() {
|
||||
...codesignCheckCommands,
|
||||
]);
|
||||
expect(
|
||||
() async => await runner.run(<String>['codesign', '--$kVerify', '--$kRevision', revision]),
|
||||
() async => runner.run(<String>['codesign', '--$kVerify', '--$kRevision', revision]),
|
||||
throwsExceptionWith('Test failed because unsigned binaries detected.'),
|
||||
);
|
||||
expect(processManager.hasRemainingExpectations, false);
|
||||
@ -325,7 +325,7 @@ void main() {
|
||||
...codesignCheckCommands,
|
||||
]);
|
||||
expect(
|
||||
() async => await runner.run(<String>['codesign', '--$kVerify', '--$kRevision', revision]),
|
||||
() async => runner.run(<String>['codesign', '--$kVerify', '--$kRevision', revision]),
|
||||
throwsExceptionWith('Test failed because files found with the wrong entitlements'),
|
||||
);
|
||||
expect(processManager.hasRemainingExpectations, false);
|
||||
|
@ -2215,7 +2215,7 @@ Future<TimeOfDay?> showTimePicker({
|
||||
confirmText: confirmText,
|
||||
helpText: helpText,
|
||||
);
|
||||
return await showDialog<TimeOfDay>(
|
||||
return showDialog<TimeOfDay>(
|
||||
context: context,
|
||||
useRootNavigator: useRootNavigator,
|
||||
builder: (BuildContext context) {
|
||||
|
@ -676,7 +676,7 @@ abstract class AssetBundleImageProvider extends ImageProvider<AssetBundleImageKe
|
||||
PaintingBinding.instance!.imageCache!.evict(key);
|
||||
throw StateError('Unable to read data');
|
||||
}
|
||||
return await decode(data.buffer.asUint8List());
|
||||
return decode(data.buffer.asUint8List());
|
||||
}
|
||||
}
|
||||
|
||||
@ -887,7 +887,7 @@ class FileImage extends ImageProvider<FileImage> {
|
||||
throw StateError('$file is empty and cannot be loaded as an image.');
|
||||
}
|
||||
|
||||
return await decode(bytes);
|
||||
return decode(bytes);
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -1259,7 +1259,7 @@ class _WidgetsAppState extends State<WidgetsApp> with WidgetsBindingObserver {
|
||||
final NavigatorState? navigator = _navigator?.currentState;
|
||||
if (navigator == null)
|
||||
return false;
|
||||
return await navigator.maybePop();
|
||||
return navigator.maybePop();
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -1357,7 +1357,7 @@ abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T
|
||||
if (await callback() != true)
|
||||
return RoutePopDisposition.doNotPop;
|
||||
}
|
||||
return await super.willPop();
|
||||
return super.willPop();
|
||||
}
|
||||
|
||||
/// Enables this route to veto attempts by the user to dismiss it.
|
||||
|
@ -34,7 +34,7 @@ Object getAssertionErrorWithLongMessage() {
|
||||
}
|
||||
|
||||
Future<StackTrace> getSampleStack() async {
|
||||
return await Future<StackTrace>.sync(() => StackTrace.current);
|
||||
return Future<StackTrace>.sync(() => StackTrace.current);
|
||||
}
|
||||
|
||||
Future<void> main() async {
|
||||
|
@ -598,7 +598,7 @@ void main() {
|
||||
testWidgets('Checkbox responds to density changes.', (WidgetTester tester) async {
|
||||
const Key key = Key('test');
|
||||
Future<void> buildTest(VisualDensity visualDensity) async {
|
||||
return await tester.pumpWidget(
|
||||
return tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Material(
|
||||
child: Center(
|
||||
|
@ -2690,7 +2690,7 @@ void main() {
|
||||
const Key iconKey = Key('test icon');
|
||||
const Key avatarKey = Key('test avatar');
|
||||
Future<void> buildTest(VisualDensity visualDensity) async {
|
||||
return await tester.pumpWidget(
|
||||
return tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Material(
|
||||
child: Center(
|
||||
|
@ -608,7 +608,7 @@ void main() {
|
||||
const Key childKey = Key('test child');
|
||||
|
||||
Future<void> buildTest(VisualDensity visualDensity, {bool useText = false}) async {
|
||||
return await tester.pumpWidget(
|
||||
return tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Directionality(
|
||||
textDirection: TextDirection.rtl,
|
||||
|
@ -768,7 +768,7 @@ void main() {
|
||||
const Key childKey = Key('test child');
|
||||
|
||||
Future<void> buildTest(VisualDensity visualDensity, {bool useText = false}) async {
|
||||
return await tester.pumpWidget(
|
||||
return tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Directionality(
|
||||
textDirection: TextDirection.rtl,
|
||||
|
@ -605,7 +605,7 @@ void main() {
|
||||
testWidgets('IconButton responds to density changes.', (WidgetTester tester) async {
|
||||
const Key key = Key('test');
|
||||
Future<void> buildTest(VisualDensity visualDensity) async {
|
||||
return await tester.pumpWidget(
|
||||
return tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Material(
|
||||
child: Center(
|
||||
|
@ -258,7 +258,7 @@ void main() {
|
||||
|
||||
final FocusNode focusNode = FocusNode(debugLabel: 'Test Node');
|
||||
Future<void> buildTest(Intent intent) async {
|
||||
return await tester.pumpWidget(
|
||||
return tester.pumpWidget(
|
||||
Shortcuts(
|
||||
shortcuts: <LogicalKeySet, Intent>{
|
||||
LogicalKeySet(LogicalKeyboardKey.space): intent,
|
||||
|
@ -3356,7 +3356,7 @@ void main() {
|
||||
bool enabled = true,
|
||||
bool filled = true,
|
||||
}) async {
|
||||
return await tester.pumpWidget(
|
||||
return tester.pumpWidget(
|
||||
buildInputDecorator(
|
||||
isHovering: hovering,
|
||||
decoration: InputDecoration(
|
||||
@ -3435,7 +3435,7 @@ void main() {
|
||||
bool enabled = true,
|
||||
bool filled = true,
|
||||
}) async {
|
||||
return await tester.pumpWidget(
|
||||
return tester.pumpWidget(
|
||||
buildInputDecorator(
|
||||
isFocused: focused,
|
||||
decoration: InputDecoration(
|
||||
@ -3486,7 +3486,7 @@ void main() {
|
||||
bool empty = true,
|
||||
bool directional = false,
|
||||
}) async {
|
||||
return await tester.pumpWidget(
|
||||
return tester.pumpWidget(
|
||||
buildInputDecorator(
|
||||
isEmpty: empty,
|
||||
isFocused: focused,
|
||||
|
@ -1419,7 +1419,7 @@ void main() {
|
||||
testWidgets('ListTile responds to density changes.', (WidgetTester tester) async {
|
||||
const Key key = Key('test');
|
||||
Future<void> buildTest(VisualDensity visualDensity) async {
|
||||
return await tester.pumpWidget(
|
||||
return tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Material(
|
||||
child: Center(
|
||||
|
@ -787,7 +787,7 @@ void main() {
|
||||
const Key childKey = Key('test child');
|
||||
|
||||
Future<void> buildTest(VisualDensity visualDensity, {bool useText = false}) async {
|
||||
return await tester.pumpWidget(
|
||||
return tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Directionality(
|
||||
textDirection: TextDirection.rtl,
|
||||
|
@ -1168,7 +1168,7 @@ void main() {
|
||||
const Key childKey = Key('test child');
|
||||
|
||||
Future<void> buildTest(VisualDensity visualDensity, {bool useText = false}) async {
|
||||
return await tester.pumpWidget(
|
||||
return tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Directionality(
|
||||
textDirection: TextDirection.rtl,
|
||||
|
@ -921,7 +921,7 @@ void main() {
|
||||
const Key childKey = Key('test child');
|
||||
|
||||
Future<void> buildTest(VisualDensity visualDensity, {bool useText = false}) async {
|
||||
return await tester.pumpWidget(
|
||||
return tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Directionality(
|
||||
textDirection: TextDirection.rtl,
|
||||
|
@ -632,7 +632,7 @@ void main() {
|
||||
testWidgets('Radio responds to density changes.', (WidgetTester tester) async {
|
||||
const Key key = Key('test');
|
||||
Future<void> buildTest(VisualDensity visualDensity) async {
|
||||
return await tester.pumpWidget(
|
||||
return tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Material(
|
||||
child: Center(
|
||||
|
@ -633,7 +633,7 @@ void main() {
|
||||
const Key childKey = Key('test child');
|
||||
|
||||
Future<void> buildTest(VisualDensity visualDensity, {bool useText = false}) async {
|
||||
return await tester.pumpWidget(
|
||||
return tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Directionality(
|
||||
textDirection: TextDirection.rtl,
|
||||
|
@ -516,7 +516,7 @@ void main() {
|
||||
const Key childKey = Key('test child');
|
||||
|
||||
Future<void> buildTest(VisualDensity visualDensity, {bool useText = false}) async {
|
||||
return await tester.pumpWidget(
|
||||
return tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Directionality(
|
||||
textDirection: TextDirection.rtl,
|
||||
|
@ -702,7 +702,7 @@ void main() {
|
||||
const Key childKey = Key('test child');
|
||||
|
||||
Future<void> buildTest(VisualDensity visualDensity, { bool useText = false }) async {
|
||||
return await tester.pumpWidget(
|
||||
return tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Directionality(
|
||||
textDirection: TextDirection.rtl,
|
||||
|
@ -148,7 +148,7 @@ Future<Size> _resolveAndGetSize(ImageProvider imageProvider,
|
||||
}
|
||||
);
|
||||
stream.addListener(listener);
|
||||
return await completer.future;
|
||||
return completer.future;
|
||||
}
|
||||
|
||||
// This version of MemoryImage guarantees obtainKey returns a future that has not been
|
||||
|
@ -351,7 +351,7 @@ class VMServiceFlutterDriver extends FlutterDriver {
|
||||
}
|
||||
|
||||
Future<vms.Timestamp> _getVMTimelineMicros() async {
|
||||
return await _serviceClient.getVMTimelineMicros();
|
||||
return _serviceClient.getVMTimelineMicros();
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -956,7 +956,7 @@ void main() {
|
||||
|
||||
Future<Map<String, dynamic>> getText(SerializableFinder finder) async {
|
||||
final Map<String, String> arguments = GetText(finder, timeout: const Duration(seconds: 1)).serialize();
|
||||
return await driverExtension.call(arguments);
|
||||
return driverExtension.call(arguments);
|
||||
}
|
||||
|
||||
await tester.pumpWidget(debugTree);
|
||||
@ -1023,7 +1023,7 @@ void main() {
|
||||
|
||||
Future<Map<String, dynamic>> tap(SerializableFinder finder) async {
|
||||
final Map<String, String> arguments = Tap(finder, timeout: const Duration(seconds: 1)).serialize();
|
||||
return await driverExtension.call(arguments);
|
||||
return driverExtension.call(arguments);
|
||||
}
|
||||
|
||||
await tester.pumpWidget(debugTree);
|
||||
@ -1066,7 +1066,7 @@ void main() {
|
||||
|
||||
Future<Map<String, dynamic>> invokeCommand(SerializableFinder finder, int times) async {
|
||||
final Map<String, String> arguments = StubNestedCommand(finder, times).serialize();
|
||||
return await driverExtension.call(arguments);
|
||||
return driverExtension.call(arguments);
|
||||
}
|
||||
|
||||
await tester.pumpWidget(debugTree);
|
||||
|
@ -625,7 +625,7 @@ class KeyEventSimulator {
|
||||
///
|
||||
/// - [simulateKeyUpEvent] to simulate the corresponding key up event.
|
||||
static Future<bool> simulateKeyDownEvent(LogicalKeyboardKey key, {String? platform, PhysicalKeyboardKey? physicalKey}) async {
|
||||
return await TestAsyncUtils.guard<bool>(() async {
|
||||
return TestAsyncUtils.guard<bool>(() async {
|
||||
platform ??= Platform.operatingSystem;
|
||||
assert(_osIsSupported(platform!), 'Platform $platform not supported for key simulation');
|
||||
|
||||
|
@ -50,7 +50,7 @@ Future<ui.Image> createTestImage({
|
||||
|
||||
Future<ui.Image> _createImage(int width, int height) async {
|
||||
if (kIsWeb) {
|
||||
return await _webCreateTestImage(
|
||||
return _webCreateTestImage(
|
||||
width: width,
|
||||
height: height,
|
||||
);
|
||||
@ -66,7 +66,7 @@ Future<ui.Image> _createImage(int width, int height) async {
|
||||
completer.complete(image);
|
||||
},
|
||||
);
|
||||
return await completer.future;
|
||||
return completer.future;
|
||||
}
|
||||
|
||||
/// Web doesn't support [decodeImageFromPixels]. Instead, generate a 1bpp BMP
|
||||
|
@ -57,7 +57,7 @@ Future<int> run(
|
||||
String getVersion() => flutterVersion ?? globals.flutterVersion.getVersionString(redactUnknownBranches: true);
|
||||
Object firstError;
|
||||
StackTrace firstStackTrace;
|
||||
return await runZoned<Future<int>>(() async {
|
||||
return runZoned<Future<int>>(() async {
|
||||
try {
|
||||
await runner.run(args);
|
||||
|
||||
@ -74,7 +74,7 @@ Future<int> run(
|
||||
} catch (error, stackTrace) { // ignore: avoid_catches_without_on_clauses
|
||||
firstError = error;
|
||||
firstStackTrace = stackTrace;
|
||||
return await _handleToolError(
|
||||
return _handleToolError(
|
||||
error, stackTrace, verbose, args, reportCrashes, getVersion);
|
||||
}
|
||||
}, onError: (Object error, StackTrace stackTrace) async { // ignore: deprecated_member_use
|
||||
|
@ -65,7 +65,7 @@ class ApplicationPackageFactory {
|
||||
case TargetPlatform.android_x64:
|
||||
case TargetPlatform.android_x86:
|
||||
if (applicationBinary == null) {
|
||||
return await AndroidApk.fromAndroidProject(
|
||||
return AndroidApk.fromAndroidProject(
|
||||
FlutterProject.current().android,
|
||||
processManager: _processManager,
|
||||
processUtils: _processUtils,
|
||||
|
@ -148,7 +148,7 @@ class AppContext {
|
||||
Map<Type, Generator>.unmodifiable(overrides ?? const <Type, Generator>{}),
|
||||
Map<Type, Generator>.unmodifiable(fallbacks ?? const <Type, Generator>{}),
|
||||
);
|
||||
return await runZoned<Future<V>>(
|
||||
return runZoned<Future<V>>(
|
||||
() async => await body(),
|
||||
zoneValues: <_Key, AppContext>{_Key.key: child},
|
||||
zoneSpecification: zoneSpecification,
|
||||
|
@ -95,5 +95,5 @@ class DartDevelopmentService {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> shutdown() async => await _ddsInstance?.shutdown();
|
||||
Future<void> shutdown() async => _ddsInstance?.shutdown();
|
||||
}
|
||||
|
@ -543,7 +543,7 @@ class _DefaultProcessUtils implements ProcessUtils {
|
||||
unawaited(stdoutSubscription.cancel());
|
||||
unawaited(stderrSubscription.cancel());
|
||||
|
||||
return await process.exitCode;
|
||||
return process.exitCode;
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -74,7 +74,7 @@ Future<T> runInContext<T>(
|
||||
return runner();
|
||||
}
|
||||
|
||||
return await context.run<T>(
|
||||
return context.run<T>(
|
||||
name: 'global fallbacks',
|
||||
body: runnerWrapper,
|
||||
overrides: overrides,
|
||||
|
@ -661,7 +661,7 @@ class FuchsiaDevice extends Device {
|
||||
throwToolExit('Cannot interact with device. No ssh config.\n'
|
||||
'Try setting FUCHSIA_SSH_CONFIG or FUCHSIA_BUILD_DIR.');
|
||||
}
|
||||
return await globals.processUtils.run(<String>[
|
||||
return globals.processUtils.run(<String>[
|
||||
'ssh',
|
||||
'-F',
|
||||
globals.fuchsiaArtifacts.sshConfig.absolute.path,
|
||||
@ -676,7 +676,7 @@ class FuchsiaDevice extends Device {
|
||||
throwToolExit('Cannot interact with device. No ssh config.\n'
|
||||
'Try setting FUCHSIA_SSH_CONFIG or FUCHSIA_BUILD_DIR.');
|
||||
}
|
||||
return await globals.processUtils.run(<String>[
|
||||
return globals.processUtils.run(<String>[
|
||||
'scp',
|
||||
'-F',
|
||||
globals.fuchsiaArtifacts.sshConfig.absolute.path,
|
||||
|
@ -245,7 +245,7 @@ class FuchsiaPackageServer {
|
||||
if (_process == null) {
|
||||
return false;
|
||||
}
|
||||
return await fuchsiaSdk.fuchsiaPM.publish(_repo, package.path);
|
||||
return fuchsiaSdk.fuchsiaPM.publish(_repo, package.path);
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -119,7 +119,7 @@ class IOSDevices extends PollingDeviceDiscovery {
|
||||
);
|
||||
}
|
||||
|
||||
return await _xcdevice.getAvailableIOSDevices(timeout: timeout);
|
||||
return _xcdevice.getAvailableIOSDevices(timeout: timeout);
|
||||
}
|
||||
|
||||
@override
|
||||
@ -130,7 +130,7 @@ class IOSDevices extends PollingDeviceDiscovery {
|
||||
];
|
||||
}
|
||||
|
||||
return await _xcdevice.getDiagnostics();
|
||||
return _xcdevice.getDiagnostics();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -162,7 +162,7 @@ class MDnsObservatoryDiscovery {
|
||||
final String host = usesIpv6
|
||||
? InternetAddress.loopbackIPv6.address
|
||||
: InternetAddress.loopbackIPv4.address;
|
||||
return await buildObservatoryUri(
|
||||
return buildObservatoryUri(
|
||||
device,
|
||||
host,
|
||||
result.port,
|
||||
|
@ -102,7 +102,7 @@ ${_projectMetadataInformation()}
|
||||
'&body=${Uri.encodeQueryComponent(body)}'
|
||||
'&labels=${Uri.encodeQueryComponent('tool,severe: crash')}';
|
||||
|
||||
return await _shortURL(fullURL);
|
||||
return _shortURL(fullURL);
|
||||
}
|
||||
|
||||
/// Provide information about the Flutter project in the working directory, if present.
|
||||
|
@ -1183,7 +1183,7 @@ abstract class FlutterCommand extends Command<void> {
|
||||
Usage.command(commandPath, parameters: additionalUsageValues);
|
||||
}
|
||||
|
||||
return await runCommand();
|
||||
return runCommand();
|
||||
}
|
||||
|
||||
Future<void> _sendNullSafetyAnalyticsEvents(FlutterProject project) async {
|
||||
|
@ -250,7 +250,7 @@ void main() {
|
||||
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
|
||||
discoverer.addDevice(MockAndroidDevice());
|
||||
|
||||
return await responses.stream.skipWhile(_isConnectedEvent).first.then<void>((Map<String, dynamic> response) async {
|
||||
return responses.stream.skipWhile(_isConnectedEvent).first.then<void>((Map<String, dynamic> response) async {
|
||||
expect(response['event'], 'device.added');
|
||||
expect(response['params'], isMap);
|
||||
|
||||
|
@ -49,7 +49,7 @@ void main() {
|
||||
.thenAnswer((_) async => true);
|
||||
testDeviceManager.addDevice(device);
|
||||
|
||||
expect(() async => await createTestCommandRunner(command).run(<String>['install', '--device-user', '10']),
|
||||
expect(() async => createTestCommandRunner(command).run(<String>['install', '--device-user', '10']),
|
||||
throwsToolExit(message: '--device-user is only supported for Android'));
|
||||
}, overrides: <Type, Generator>{
|
||||
Cache: () => Cache.test(),
|
||||
|
@ -164,7 +164,7 @@ void main() {
|
||||
testUsingContext('cannot create a project if non-empty non-project directory exists with .metadata', () async {
|
||||
await projectDir.absolute.childDirectory('blag').create(recursive: true);
|
||||
await projectDir.absolute.childFile('.metadata').writeAsString('project_type: blag\n');
|
||||
expect(() async => await _createAndAnalyzeProject(
|
||||
expect(() async => _createAndAnalyzeProject(
|
||||
projectDir,
|
||||
<String>[],
|
||||
<String>[],
|
||||
|
@ -200,7 +200,7 @@ void main() {
|
||||
]);
|
||||
|
||||
await expectLater(
|
||||
() async => await realCommandRunner.fetchLatestVersion(),
|
||||
() async => realCommandRunner.fetchLatestVersion(),
|
||||
throwsToolExit(message: 'You are not currently on a release branch.'),
|
||||
);
|
||||
expect(processManager.hasRemainingExpectations, isFalse);
|
||||
@ -225,7 +225,7 @@ void main() {
|
||||
]);
|
||||
|
||||
await expectLater(
|
||||
() async => await realCommandRunner.fetchLatestVersion(),
|
||||
() async => realCommandRunner.fetchLatestVersion(),
|
||||
throwsToolExit(
|
||||
message: 'Unable to upgrade Flutter: no origin repository configured.',
|
||||
),
|
||||
@ -251,7 +251,7 @@ void main() {
|
||||
);
|
||||
|
||||
await expectLater(
|
||||
() async => await realCommandRunner.attemptReset(revision),
|
||||
() async => realCommandRunner.attemptReset(revision),
|
||||
throwsToolExit(message: errorMessage),
|
||||
);
|
||||
expect(processManager.hasRemainingExpectations, isFalse);
|
||||
|
@ -854,7 +854,7 @@ void main() {
|
||||
fileSystem.directory('build/outputs/repo').createSync(recursive: true);
|
||||
|
||||
await expectLater(() async =>
|
||||
await builder.buildGradleAar(
|
||||
builder.buildGradleAar(
|
||||
androidBuildInfo: const AndroidBuildInfo(BuildInfo(BuildMode.release, null, treeShakeIcons: false)),
|
||||
project: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory),
|
||||
outputDirectory: fileSystem.directory('build/'),
|
||||
|
@ -175,7 +175,7 @@ void main() {
|
||||
..createSync(),
|
||||
);
|
||||
|
||||
await expectLater(() async => await artifactUpdater.downloadZipArchive(
|
||||
await expectLater(() async => artifactUpdater.downloadZipArchive(
|
||||
'test message',
|
||||
Uri.parse('http://test.zip'),
|
||||
fileSystem.currentDirectory.childDirectory('out'),
|
||||
@ -230,7 +230,7 @@ void main() {
|
||||
..createSync(),
|
||||
);
|
||||
|
||||
await expectLater(() async => await artifactUpdater.downloadZipArchive(
|
||||
await expectLater(() async => artifactUpdater.downloadZipArchive(
|
||||
'test message',
|
||||
Uri.parse('http://test.zip'),
|
||||
fileSystem.currentDirectory.childDirectory('out'),
|
||||
@ -260,7 +260,7 @@ void main() {
|
||||
..createSync(),
|
||||
);
|
||||
|
||||
await expectLater(() async => await artifactUpdater.downloadZipArchive(
|
||||
await expectLater(() async => artifactUpdater.downloadZipArchive(
|
||||
'test message',
|
||||
Uri.parse('http:///foo-bar/test.zip'),
|
||||
fileSystem.currentDirectory.childDirectory('out'),
|
||||
@ -286,7 +286,7 @@ void main() {
|
||||
..createSync(),
|
||||
);
|
||||
|
||||
await expectLater(() async => await artifactUpdater.downloadZipArchive(
|
||||
await expectLater(() async => artifactUpdater.downloadZipArchive(
|
||||
'test message',
|
||||
Uri.parse('http://test.zip'),
|
||||
fileSystem.currentDirectory.childDirectory('out'),
|
||||
@ -461,7 +461,7 @@ void main() {
|
||||
..createSync(recursive: true);
|
||||
handler.addError(errorDirectory, FileSystemOp.delete, const FileSystemException('', '', OSError('', kSharingViolation)));
|
||||
|
||||
await expectLater(() async => await artifactUpdater.downloadZippedTarball(
|
||||
await expectLater(() async => artifactUpdater.downloadZippedTarball(
|
||||
'test message',
|
||||
Uri.parse('http://test.zip'),
|
||||
fileSystem.currentDirectory.childDirectory('out'),
|
||||
|
@ -226,9 +226,9 @@ void main() {
|
||||
final File file = fs.file('file');
|
||||
|
||||
const String expectedMessage = 'The flutter tool cannot access the file';
|
||||
expect(() async => await file.writeAsBytes(<int>[0]),
|
||||
expect(() async => file.writeAsBytes(<int>[0]),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() async => await file.writeAsString(''),
|
||||
expect(() async => file.writeAsString(''),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => file.writeAsBytesSync(<int>[0]),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -250,9 +250,9 @@ void main() {
|
||||
final File file = fs.file('file');
|
||||
|
||||
const String expectedMessage = 'The target device is full';
|
||||
expect(() async => await file.writeAsBytes(<int>[0]),
|
||||
expect(() async => file.writeAsBytes(<int>[0]),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() async => await file.writeAsString(''),
|
||||
expect(() async => file.writeAsString(''),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => file.writeAsBytesSync(<int>[0]),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -270,9 +270,9 @@ void main() {
|
||||
final File file = fs.file('file');
|
||||
|
||||
const String expectedMessage = 'The file is being used by another program';
|
||||
expect(() async => await file.writeAsBytes(<int>[0]),
|
||||
expect(() async => file.writeAsBytes(<int>[0]),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() async => await file.writeAsString(''),
|
||||
expect(() async => file.writeAsString(''),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => file.writeAsBytesSync(<int>[0]),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -291,9 +291,9 @@ void main() {
|
||||
|
||||
const String expectedMessage = 'There is a problem with the device driver '
|
||||
'that this file or directory is stored on';
|
||||
expect(() async => await file.writeAsBytes(<int>[0]),
|
||||
expect(() async => file.writeAsBytes(<int>[0]),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() async => await file.writeAsString(''),
|
||||
expect(() async => file.writeAsString(''),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => file.writeAsBytesSync(<int>[0]),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -315,7 +315,7 @@ void main() {
|
||||
final Directory directory = fs.directory('directory');
|
||||
|
||||
const String expectedMessage = 'The target device is full';
|
||||
expect(() async => await directory.createTemp('prefix'),
|
||||
expect(() async => directory.createTemp('prefix'),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => directory.createTempSync('prefix'),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -392,9 +392,9 @@ void main() {
|
||||
final File file = fs.file('file');
|
||||
|
||||
const String expectedMessage = 'The flutter tool cannot access the file or directory';
|
||||
expect(() async => await file.writeAsBytes(<int>[0]),
|
||||
expect(() async => file.writeAsBytes(<int>[0]),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() async => await file.writeAsString(''),
|
||||
expect(() async => file.writeAsString(''),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => file.writeAsBytesSync(<int>[0]),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -416,9 +416,9 @@ void main() {
|
||||
final Directory directory = fs.directory('file');
|
||||
|
||||
const String expectedMessage = 'The flutter tool cannot access the file or directory';
|
||||
expect(() async => await directory.create(),
|
||||
expect(() async => directory.create(),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() async => await directory.delete(),
|
||||
expect(() async => directory.delete(),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => directory.createSync(),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -436,9 +436,9 @@ void main() {
|
||||
final File file = fs.file('file');
|
||||
|
||||
const String expectedMessage = 'The target device is full';
|
||||
expect(() async => await file.writeAsBytes(<int>[0]),
|
||||
expect(() async => file.writeAsBytes(<int>[0]),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() async => await file.writeAsString(''),
|
||||
expect(() async => file.writeAsString(''),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => file.writeAsBytesSync(<int>[0]),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -456,7 +456,7 @@ void main() {
|
||||
final Directory directory = fs.directory('directory');
|
||||
|
||||
const String expectedMessage = 'The target device is full';
|
||||
expect(() async => await directory.createTemp('prefix'),
|
||||
expect(() async => directory.createTemp('prefix'),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => directory.createTempSync('prefix'),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -503,9 +503,9 @@ void main() {
|
||||
final File file = fs.file('file');
|
||||
|
||||
const String expectedMessage = 'The flutter tool cannot access the file';
|
||||
expect(() async => await file.writeAsBytes(<int>[0]),
|
||||
expect(() async => file.writeAsBytes(<int>[0]),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() async => await file.writeAsString(''),
|
||||
expect(() async => file.writeAsString(''),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => file.writeAsBytesSync(<int>[0]),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -525,9 +525,9 @@ void main() {
|
||||
final Directory directory = fs.directory('file');
|
||||
|
||||
const String expectedMessage = 'The flutter tool cannot access the file or directory';
|
||||
expect(() async => await directory.create(),
|
||||
expect(() async => directory.create(),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() async => await directory.delete(),
|
||||
expect(() async => directory.delete(),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => directory.createSync(),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -545,9 +545,9 @@ void main() {
|
||||
final File file = fs.file('file');
|
||||
|
||||
const String expectedMessage = 'The target device is full';
|
||||
expect(() async => await file.writeAsBytes(<int>[0]),
|
||||
expect(() async => file.writeAsBytes(<int>[0]),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() async => await file.writeAsString(''),
|
||||
expect(() async => file.writeAsString(''),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => file.writeAsBytesSync(<int>[0]),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -565,7 +565,7 @@ void main() {
|
||||
final Directory directory = fs.directory('directory');
|
||||
|
||||
const String expectedMessage = 'The target device is full';
|
||||
expect(() async => await directory.createTemp('prefix'),
|
||||
expect(() async => directory.createTemp('prefix'),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => directory.createTempSync('prefix'),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -709,9 +709,9 @@ void main() {
|
||||
|
||||
const String expectedMessage = 'The target device is full';
|
||||
|
||||
expect(() async => await processManager.start(<String>['foo']),
|
||||
expect(() async => processManager.start(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() async => await processManager.run(<String>['foo']),
|
||||
expect(() async => processManager.run(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => processManager.runSync(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -730,9 +730,9 @@ void main() {
|
||||
);
|
||||
|
||||
const String expectedMessage = 'The file is being used by another program';
|
||||
expect(() async => await processManager.start(<String>['foo']),
|
||||
expect(() async => processManager.start(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() async => await processManager.run(<String>['foo']),
|
||||
expect(() async => processManager.run(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => processManager.runSync(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -751,9 +751,9 @@ void main() {
|
||||
);
|
||||
|
||||
const String expectedMessage = 'The flutter tool cannot access the file';
|
||||
expect(() async => await processManager.start(<String>['foo']),
|
||||
expect(() async => processManager.start(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() async => await processManager.run(<String>['foo']),
|
||||
expect(() async => processManager.run(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => processManager.runSync(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -777,9 +777,9 @@ void main() {
|
||||
);
|
||||
|
||||
const String expectedMessage = 'The target device is full';
|
||||
expect(() async => await processManager.start(<String>['foo']),
|
||||
expect(() async => processManager.start(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() async => await processManager.run(<String>['foo']),
|
||||
expect(() async => processManager.run(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => processManager.runSync(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -798,9 +798,9 @@ void main() {
|
||||
|
||||
const String expectedMessage = 'The flutter tool cannot access the file';
|
||||
|
||||
expect(() async => await processManager.start(<String>['foo']),
|
||||
expect(() async => processManager.start(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() async => await processManager.run(<String>['foo']),
|
||||
expect(() async => processManager.run(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => processManager.runSync(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -824,9 +824,9 @@ void main() {
|
||||
|
||||
const String expectedMessage = 'The target device is full';
|
||||
|
||||
expect(() async => await processManager.start(<String>['foo']),
|
||||
expect(() async => processManager.start(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() async => await processManager.run(<String>['foo']),
|
||||
expect(() async => processManager.run(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => processManager.runSync(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
@ -845,9 +845,9 @@ void main() {
|
||||
|
||||
const String expectedMessage = 'The flutter tool cannot access the file';
|
||||
|
||||
expect(() async => await processManager.start(<String>['foo']),
|
||||
expect(() async => processManager.start(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() async => await processManager.run(<String>['foo']),
|
||||
expect(() async => processManager.run(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
expect(() => processManager.runSync(<String>['foo']),
|
||||
throwsToolExit(message: expectedMessage));
|
||||
|
@ -340,8 +340,8 @@ void main() {
|
||||
logger.printStatus('message');
|
||||
logger.printError('error message');
|
||||
|
||||
expect(() async => await stdout.done, throwsA(isA<Exception>()));
|
||||
expect(() async => await stderr.done, throwsA(isA<Exception>()));
|
||||
expect(() async => stdout.done, throwsA(isA<Exception>()));
|
||||
expect(() async => stderr.done, throwsA(isA<Exception>()));
|
||||
});
|
||||
|
||||
group('Spinners', () {
|
||||
|
@ -40,7 +40,7 @@ void main() {
|
||||
exitCode: 1,
|
||||
));
|
||||
|
||||
expect(() async => await processUtils.run(<String>['false'], throwOnError: true),
|
||||
expect(() async => processUtils.run(<String>['false'], throwOnError: true),
|
||||
throwsA(isA<ProcessException>()));
|
||||
});
|
||||
});
|
||||
@ -518,7 +518,7 @@ void main() {
|
||||
ArgumentError('Bad input'),
|
||||
);
|
||||
expect(
|
||||
() async => await processUtils.exitsHappy(<String>['invalid']),
|
||||
() async => processUtils.exitsHappy(<String>['invalid']),
|
||||
throwsArgumentError,
|
||||
);
|
||||
});
|
||||
|
@ -113,7 +113,7 @@ flutter:
|
||||
|
||||
''');
|
||||
|
||||
expect(() async => await const CopyAssets().build(environment),
|
||||
expect(() async => const CopyAssets().build(environment),
|
||||
throwsA(isA<Exception>()));
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fileSystem,
|
||||
|
@ -222,7 +222,7 @@ void main() {
|
||||
);
|
||||
|
||||
expect(
|
||||
() async => await iconTreeShaker.subsetFont(
|
||||
() async => iconTreeShaker.subsetFont(
|
||||
input: fileSystem.file(inputPath),
|
||||
outputPath: outputPath,
|
||||
relativePath: relativePath,
|
||||
@ -362,7 +362,7 @@ void main() {
|
||||
_addConstFinderInvocation(appDill.path, stdout: constFinderResultWithInvalid);
|
||||
|
||||
await expectLater(
|
||||
() async => await iconTreeShaker.subsetFont(
|
||||
() async => iconTreeShaker.subsetFont(
|
||||
input: fileSystem.file(inputPath),
|
||||
outputPath: outputPath,
|
||||
relativePath: relativePath,
|
||||
@ -401,7 +401,7 @@ void main() {
|
||||
_resetFontSubsetInvocation(exitCode: -1, stdinSink: stdinSink);
|
||||
|
||||
await expectLater(
|
||||
() async => await iconTreeShaker.subsetFont(
|
||||
() async => iconTreeShaker.subsetFont(
|
||||
input: fileSystem.file(inputPath),
|
||||
outputPath: outputPath,
|
||||
relativePath: relativePath,
|
||||
@ -435,7 +435,7 @@ void main() {
|
||||
_resetFontSubsetInvocation(exitCode: -1, stdinSink: stdinSink);
|
||||
|
||||
await expectLater(
|
||||
() async => await iconTreeShaker.subsetFont(
|
||||
() async => iconTreeShaker.subsetFont(
|
||||
input: fileSystem.file(inputPath),
|
||||
outputPath: outputPath,
|
||||
relativePath: relativePath,
|
||||
@ -469,7 +469,7 @@ void main() {
|
||||
_addConstFinderInvocation(appDill.path, stdout: validConstFinderResult);
|
||||
|
||||
await expectLater(
|
||||
() async => await iconTreeShaker.subsetFont(
|
||||
() async => iconTreeShaker.subsetFont(
|
||||
input: fileSystem.file(inputPath),
|
||||
outputPath: outputPath,
|
||||
relativePath: relativePath,
|
||||
@ -503,7 +503,7 @@ void main() {
|
||||
_addConstFinderInvocation(appDill.path, exitCode: -1);
|
||||
|
||||
await expectLater(
|
||||
() async => await iconTreeShaker.subsetFont(
|
||||
() async => iconTreeShaker.subsetFont(
|
||||
input: fileSystem.file(inputPath),
|
||||
outputPath: outputPath,
|
||||
relativePath: relativePath,
|
||||
|
@ -94,7 +94,7 @@ void main() {
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('testing');
|
||||
|
||||
expect(() async => await const DebugMacOSBundleFlutterAssets().build(environment),
|
||||
expect(() async => const DebugMacOSBundleFlutterAssets().build(environment),
|
||||
throwsException);
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fileSystem,
|
||||
|
@ -95,7 +95,7 @@ void main() {
|
||||
fileSystem.file(fileSystem.path.join('bin', 'cache', 'lockfile'))
|
||||
.createSync(recursive: true);
|
||||
|
||||
expect(() async => await cache.lock(), throwsToolExit());
|
||||
expect(() async => cache.lock(), throwsToolExit());
|
||||
}, skip: true); // TODO(jonahwilliams): implement support for lock so this can be tested with the memory file system.
|
||||
|
||||
testWithoutContext('should not throw when FLUTTER_ALREADY_LOCKED is set', () {
|
||||
|
@ -127,7 +127,7 @@ void main() {
|
||||
logger: BufferLogger.test(),
|
||||
httpClient: FakeHttpClient.any(),
|
||||
);
|
||||
expect(() async => await devFS.create(), throwsA(isA<DevFSException>()));
|
||||
expect(() async => devFS.create(), throwsA(isA<DevFSException>()));
|
||||
});
|
||||
|
||||
testWithoutContext('DevFS destroy is resilient to vmservice disconnection', () async {
|
||||
@ -423,7 +423,7 @@ void main() {
|
||||
final File file = MockFile();
|
||||
when(file.copySync(any)).thenThrow(const FileSystemException('foo'));
|
||||
|
||||
await expectLater(() async => await writer.write(<Uri, DevFSContent>{
|
||||
await expectLater(() async => writer.write(<Uri, DevFSContent>{
|
||||
Uri.parse('goodbye'): DevFSFileContent(file),
|
||||
}, Uri.parse('/foo/bar/devfs/')), throwsA(isA<DevFSException>()));
|
||||
});
|
||||
|
@ -334,7 +334,7 @@ void main() {
|
||||
terminal: mockTerminal,
|
||||
);
|
||||
await expectLater(
|
||||
() async => await deviceManager.findTargetDevices(FakeFlutterProject()),
|
||||
() async => deviceManager.findTargetDevices(FakeFlutterProject()),
|
||||
throwsA(isA<ToolExit>())
|
||||
);
|
||||
});
|
||||
|
@ -145,7 +145,7 @@ void main() {
|
||||
))..failOnce = true;
|
||||
|
||||
await expectLater(
|
||||
() async => await driverService.start(BuildInfo.profile, device, DebuggingOptions.enabled(BuildInfo.profile), true),
|
||||
() async => driverService.start(BuildInfo.profile, device, DebuggingOptions.enabled(BuildInfo.profile), true),
|
||||
returnsNormally,
|
||||
);
|
||||
});
|
||||
|
@ -83,7 +83,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
await expectLater(() async => await emulatorManager.getAllAvailableEmulators(),
|
||||
await expectLater(() async => emulatorManager.getAllAvailableEmulators(),
|
||||
returnsNormally);
|
||||
});
|
||||
|
||||
@ -106,7 +106,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
await expectLater(() async => await emulatorManager.getAllAvailableEmulators(),
|
||||
await expectLater(() async => emulatorManager.getAllAvailableEmulators(),
|
||||
returnsNormally);
|
||||
});
|
||||
|
||||
|
@ -38,7 +38,7 @@ void main() {
|
||||
processManager: FakeProcessManager.any(),
|
||||
);
|
||||
|
||||
expect(() async => await fuchsiaDevFinder.list(),
|
||||
expect(() async => fuchsiaDevFinder.list(),
|
||||
throwsToolExit(message: 'Fuchsia device-finder tool not found.'));
|
||||
});
|
||||
|
||||
|
@ -333,7 +333,7 @@ void main() {
|
||||
return ProcessResult(1, 1, '', '');
|
||||
});
|
||||
final FuchsiaDevice device = FuchsiaDevice('id');
|
||||
expect(() async => await device.hostAddress, throwsToolExit());
|
||||
expect(() async => device.hostAddress, throwsToolExit());
|
||||
}, overrides: <Type, Generator>{
|
||||
FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: sshConfig),
|
||||
FuchsiaSdk: () => MockFuchsiaSdk(),
|
||||
@ -345,7 +345,7 @@ void main() {
|
||||
return ProcessResult(1, 0, '', '');
|
||||
});
|
||||
final FuchsiaDevice device = FuchsiaDevice('id');
|
||||
expect(() async => await device.hostAddress, throwsToolExit());
|
||||
expect(() async => device.hostAddress, throwsToolExit());
|
||||
}, overrides: <Type, Generator>{
|
||||
FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: sshConfig),
|
||||
FuchsiaSdk: () => MockFuchsiaSdk(),
|
||||
@ -745,7 +745,7 @@ void main() {
|
||||
environment: anyNamed('environment'),
|
||||
)).thenAnswer((_) async => ProcessResult(0, 0, '', ''));
|
||||
|
||||
expect(() async => await device.takeScreenshot(globals.fs.file('file.ppm')),
|
||||
expect(() async => device.takeScreenshot(globals.fs.file('file.ppm')),
|
||||
returnsNormally);
|
||||
}, overrides: <Type, Generator>{
|
||||
ProcessManager: () => MockProcessManager(),
|
||||
@ -1013,7 +1013,7 @@ void main() {
|
||||
}
|
||||
|
||||
final DebuggingOptions debuggingOptions = DebuggingOptions.disabled(BuildInfo(mode, null, treeShakeIcons: false));
|
||||
return await device.startApp(
|
||||
return device.startApp(
|
||||
app,
|
||||
prebuiltApplication: prebuilt,
|
||||
debuggingOptions: debuggingOptions,
|
||||
@ -1123,7 +1123,7 @@ void main() {
|
||||
|
||||
testUsingContext('fail when cant get ssh config', () async {
|
||||
expect(() async =>
|
||||
await setupAndStartApp(prebuilt: true, mode: BuildMode.release),
|
||||
setupAndStartApp(prebuilt: true, mode: BuildMode.release),
|
||||
throwsToolExit(message: 'Cannot interact with device. No ssh config.\n'
|
||||
'Try setting FUCHSIA_SSH_CONFIG or FUCHSIA_BUILD_DIR.'));
|
||||
}, overrides: <Type, Generator>{
|
||||
@ -1137,7 +1137,7 @@ void main() {
|
||||
|
||||
testUsingContext('fail when cant get host address', () async {
|
||||
expect(() async =>
|
||||
await setupAndStartApp(prebuilt: true, mode: BuildMode.release),
|
||||
setupAndStartApp(prebuilt: true, mode: BuildMode.release),
|
||||
throwsToolExit(message: 'Failed to get local address, aborting.'));
|
||||
}, overrides: <Type, Generator>{
|
||||
Artifacts: () => artifacts,
|
||||
|
@ -38,7 +38,7 @@ void main() {
|
||||
processManager: FakeProcessManager.any(),
|
||||
);
|
||||
|
||||
expect(() async => await fuchsiaFfx.list(),
|
||||
expect(() async => fuchsiaFfx.list(),
|
||||
throwsToolExit(message: 'Fuchsia ffx tool not found.'));
|
||||
});
|
||||
|
||||
|
@ -113,7 +113,7 @@ void main() {
|
||||
workingDirectory: anyNamed('workingDirectory'),
|
||||
)).thenAnswer((_) => Future<ProcessResult>.value(exitsHappy));
|
||||
|
||||
expect(() async => await getCodeSigningIdentityDevelopmentTeam(
|
||||
expect(() async => getCodeSigningIdentityDevelopmentTeam(
|
||||
iosApp: app,
|
||||
processManager: mockProcessManager,
|
||||
logger: logger,
|
||||
|
@ -79,7 +79,7 @@ void main() {
|
||||
logger: logger,
|
||||
);
|
||||
|
||||
expect(() async => await iMobileDevice.takeScreenshot(
|
||||
expect(() async => iMobileDevice.takeScreenshot(
|
||||
outputFile,
|
||||
'1234',
|
||||
IOSDeviceInterface.usb,
|
||||
|
@ -808,7 +808,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
|
||||
));
|
||||
|
||||
expect(
|
||||
() async => await simControl.install(deviceId, appId),
|
||||
() async => simControl.install(deviceId, appId),
|
||||
throwsToolExit(message: r'Unable to install'),
|
||||
);
|
||||
});
|
||||
@ -826,7 +826,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
|
||||
));
|
||||
|
||||
expect(
|
||||
() async => await simControl.uninstall(deviceId, appId),
|
||||
() async => simControl.uninstall(deviceId, appId),
|
||||
throwsToolExit(message: r'Unable to uninstall'),
|
||||
);
|
||||
});
|
||||
@ -844,7 +844,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
|
||||
));
|
||||
|
||||
expect(
|
||||
() async => await simControl.launch(deviceId, appId),
|
||||
() async => simControl.launch(deviceId, appId),
|
||||
throwsToolExit(message: r'Unable to launch'),
|
||||
);
|
||||
});
|
||||
|
@ -454,7 +454,7 @@ void main() {
|
||||
);
|
||||
|
||||
expect(
|
||||
() async => await xcodeProjectInterpreter.getInfo(workingDirectory),
|
||||
() async => xcodeProjectInterpreter.getInfo(workingDirectory),
|
||||
throwsToolExit(message: stderr));
|
||||
expect(fakeProcessManager.hasRemainingExpectations, isFalse);
|
||||
});
|
||||
|
@ -328,7 +328,7 @@ void main() {
|
||||
stderr: 'xcrun: error:',
|
||||
));
|
||||
|
||||
expect(() async => await xcode.sdkLocation(EnvironmentType.physical),
|
||||
expect(() async => xcode.sdkLocation(EnvironmentType.physical),
|
||||
throwsToolExit(message: 'Could not find SDK location'));
|
||||
expect(fakeProcessManager.hasRemainingExpectations, isFalse);
|
||||
});
|
||||
|
@ -213,7 +213,7 @@ void main() {
|
||||
flutterUsage: TestUsage(),
|
||||
);
|
||||
expect(
|
||||
() async => await portDiscovery.query(),
|
||||
() async => portDiscovery.query(),
|
||||
throwsA(isA<Exception>()),
|
||||
);
|
||||
});
|
||||
|
@ -82,7 +82,7 @@ void main() {
|
||||
testUsingContext('ResidentWebRunner calls appFailedToStart if initial compilation fails', () async {
|
||||
_setupMocks();
|
||||
|
||||
expect(() async => await residentWebRunner.run(), throwsToolExit());
|
||||
expect(() async => residentWebRunner.run(), throwsToolExit());
|
||||
expect(await residentWebRunner.waitForAppToFinish(), 1);
|
||||
}, overrides: <Type, Generator>{
|
||||
BuildSystem: () => TestBuildSystem.all(BuildResult(success: false)),
|
||||
@ -94,7 +94,7 @@ void main() {
|
||||
testUsingContext('ResidentWebRunner calls appFailedToStart if error is thrown during startup', () async {
|
||||
_setupMocks();
|
||||
|
||||
expect(() async => await residentWebRunner.run(), throwsA(isA<Exception>()));
|
||||
expect(() async => residentWebRunner.run(), throwsA(isA<Exception>()));
|
||||
expect(await residentWebRunner.waitForAppToFinish(), 1);
|
||||
}, overrides: <Type, Generator>{
|
||||
BuildSystem: () => TestBuildSystem.error(Exception('foo')),
|
||||
|
@ -135,7 +135,7 @@ void main() {
|
||||
final FakeTargetCommand fakeTargetCommand = FakeTargetCommand();
|
||||
final CommandRunner<void> runner = createTestCommandRunner(fakeTargetCommand);
|
||||
|
||||
expect(() async => await runner.run(<String>['test', '-t', 'lib/foo.dart']), throwsToolExit());
|
||||
expect(() async => runner.run(<String>['test', '-t', 'lib/foo.dart']), throwsToolExit());
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => MemoryFileSystem.test(),
|
||||
ProcessManager: () => FakeProcessManager.any(),
|
||||
|
@ -149,7 +149,7 @@ void main() {
|
||||
),
|
||||
]);
|
||||
|
||||
await expectLater(() async => await downloadStartupTrace(fakeVmServiceHost.vmService,
|
||||
await expectLater(() async => downloadStartupTrace(fakeVmServiceHost.vmService,
|
||||
output: fileSystem.currentDirectory,
|
||||
logger: logger,
|
||||
), throwsToolExit(message: 'The device disconnected before the timeline could be retrieved.'));
|
||||
@ -176,7 +176,7 @@ void main() {
|
||||
),
|
||||
]);
|
||||
|
||||
await expectLater(() async => await downloadStartupTrace(fakeVmServiceHost.vmService,
|
||||
await expectLater(() async => downloadStartupTrace(fakeVmServiceHost.vmService,
|
||||
output: fileSystem.currentDirectory,
|
||||
logger: logger,
|
||||
), throwsToolExit(message: 'Engine start event is missing in the timeline'));
|
||||
@ -212,7 +212,7 @@ void main() {
|
||||
),
|
||||
]);
|
||||
|
||||
await expectLater(() async => await downloadStartupTrace(fakeVmServiceHost.vmService,
|
||||
await expectLater(() async => downloadStartupTrace(fakeVmServiceHost.vmService,
|
||||
output: fileSystem.currentDirectory,
|
||||
logger: logger,
|
||||
), throwsToolExit(message: 'First frame events are missing in the timeline'));
|
||||
|
@ -61,7 +61,7 @@ void main() {
|
||||
|
||||
testWithoutContext('can launch chrome and connect to the devtools', () async {
|
||||
expect(
|
||||
() async => await _testLaunchChrome(
|
||||
() async => _testLaunchChrome(
|
||||
'/.tmp_rand0/flutter_tools_chrome_device.rand0',
|
||||
processManager,
|
||||
chromeLauncher,
|
||||
@ -78,7 +78,7 @@ void main() {
|
||||
);
|
||||
|
||||
expect(
|
||||
() async => await _testLaunchChrome(
|
||||
() async => _testLaunchChrome(
|
||||
'/.tmp_rand0/flutter_tools_chrome_device.rand1',
|
||||
processManager,
|
||||
chromeLauncher,
|
||||
@ -96,7 +96,7 @@ void main() {
|
||||
await chrome.close();
|
||||
|
||||
expect(
|
||||
() async => await _testLaunchChrome(
|
||||
() async => _testLaunchChrome(
|
||||
'/.tmp_rand0/flutter_tools_chrome_device.rand1',
|
||||
processManager,
|
||||
chromeLauncher,
|
||||
@ -206,7 +206,7 @@ void main() {
|
||||
));
|
||||
|
||||
expect(
|
||||
() async => await chromeLauncher.launch(
|
||||
() async => chromeLauncher.launch(
|
||||
'example_url',
|
||||
skipCheck: true,
|
||||
debugPort: 10000,
|
||||
@ -232,7 +232,7 @@ void main() {
|
||||
));
|
||||
|
||||
expect(
|
||||
() async => await chromeLauncher.launch(
|
||||
() async => chromeLauncher.launch(
|
||||
'example_url',
|
||||
skipCheck: true,
|
||||
headless: true,
|
||||
@ -320,7 +320,7 @@ void main() {
|
||||
));
|
||||
|
||||
expect(
|
||||
() async => await chromeLauncher.launch(
|
||||
() async => chromeLauncher.launch(
|
||||
'example_url',
|
||||
skipCheck: true,
|
||||
headless: true,
|
||||
@ -346,7 +346,7 @@ void main() {
|
||||
));
|
||||
|
||||
expect(
|
||||
() async => await chromeLauncher.launch(
|
||||
() async => chromeLauncher.launch(
|
||||
'example_url',
|
||||
skipCheck: true,
|
||||
headless: true,
|
||||
|
@ -1022,7 +1022,7 @@ void main() {
|
||||
|
||||
expect(await webAssetServer.metadataContents('foo/main_module.ddc_merged_metadata'), null);
|
||||
// Not base href.
|
||||
expect(() async => await webAssetServer.metadataContents('bar/main_module.ddc_merged_metadata'), throwsException);
|
||||
expect(() async => webAssetServer.metadataContents('bar/main_module.ddc_merged_metadata'), throwsException);
|
||||
}));
|
||||
|
||||
test('DevFS URI includes any specified base path.', () => testbed.run(() async {
|
||||
|
@ -175,7 +175,7 @@ abstract class FlutterTestDriver {
|
||||
final int port = _vmServiceWsUri != null ? vmServicePort : _attachPort;
|
||||
final VmService vmService = await vmServiceConnectUri('ws://localhost:$port/ws');
|
||||
final Isolate isolate = await waitForExtension(vmService, extension);
|
||||
return await vmService.callServiceExtension(
|
||||
return vmService.callServiceExtension(
|
||||
extension,
|
||||
isolateId: isolate.id,
|
||||
args: args,
|
||||
@ -300,9 +300,9 @@ abstract class FlutterTestDriver {
|
||||
|
||||
Future<Isolate> stepOverOrOverAsyncSuspension({ bool waitForNextPause = true }) async {
|
||||
if (await isAtAsyncSuspension()) {
|
||||
return await stepOverAsync(waitForNextPause: waitForNextPause);
|
||||
return stepOverAsync(waitForNextPause: waitForNextPause);
|
||||
}
|
||||
return await stepOver(waitForNextPause: waitForNextPause);
|
||||
return stepOver(waitForNextPause: waitForNextPause);
|
||||
}
|
||||
|
||||
Future<Isolate> _resume(String step, bool waitForNextPause) async {
|
||||
|
@ -206,7 +206,7 @@ class FuchsiaRemoteConnection {
|
||||
interface = addressAndInterface[1];
|
||||
}
|
||||
|
||||
return await FuchsiaRemoteConnection.connectWithSshCommandRunner(
|
||||
return FuchsiaRemoteConnection.connectWithSshCommandRunner(
|
||||
SshCommandRunner(
|
||||
address: address,
|
||||
interface: interface,
|
||||
@ -356,7 +356,7 @@ class FuchsiaRemoteConnection {
|
||||
}
|
||||
final List<List<FlutterView>> flutterViewLists =
|
||||
await _invokeForAllVms<List<FlutterView>>((DartVm vmService) async {
|
||||
return await vmService.getAllFlutterViews();
|
||||
return vmService.getAllFlutterViews();
|
||||
});
|
||||
final List<FlutterView> results = flutterViewLists.fold<List<FlutterView>>(
|
||||
<FlutterView>[], (List<FlutterView> acc, List<FlutterView> element) {
|
||||
|
@ -162,7 +162,7 @@ class IntegrationTestWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding
|
||||
/// The callback function to response the driver side input.
|
||||
@visibleForTesting
|
||||
Future<Map<String, dynamic>> callback(Map<String, String> params) async {
|
||||
return await callbackManager.callback(
|
||||
return callbackManager.callback(
|
||||
params, this /* as IntegrationTestResults */);
|
||||
}
|
||||
|
||||
@ -239,14 +239,14 @@ class IntegrationTestWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding
|
||||
await enableTimeline(streams: streams);
|
||||
if (retainPriorEvents) {
|
||||
await action();
|
||||
return await _vmService!.getVMTimeline();
|
||||
return _vmService!.getVMTimeline();
|
||||
}
|
||||
|
||||
await _vmService!.clearVMTimeline();
|
||||
final vm.Timestamp startTime = await _vmService!.getVMTimelineMicros();
|
||||
await action();
|
||||
final vm.Timestamp endTime = await _vmService!.getVMTimelineMicros();
|
||||
return await _vmService!.getVMTimeline(
|
||||
return _vmService!.getVMTimeline(
|
||||
timeOriginMicros: startTime.timestamp,
|
||||
timeExtentMicros: endTime.timestamp,
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user