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