Enable --sync-async in Flutter. (#17866)
This commit is contained in:
committed by
Mikkel Nygaard Ravn
parent
d5a103402c
commit
39d7f22a96
@@ -43,7 +43,10 @@ Who lives, who dies, who tells your story\?
|
||||
|
||||
When the exception was thrown, this was the stack:
|
||||
#[0-9]+ +main.<anonymous closure> \(.+[/\\]dev[/\\]automated_tests[/\\]flutter_test[/\\]exception_handling_test\.dart:16:9\)
|
||||
#[0-9]+ +main.<anonymous closure> \(.+[/\\]dev[/\\]automated_tests[/\\]flutter_test[/\\]exception_handling_test\.dart:15:77\)
|
||||
#[0-9]+ +.+ \(package:flutter_test[/\\]src[/\\]binding.dart:[0-9]+:[0-9]+\)
|
||||
#[0-9]+ +.+ \(package:flutter_test[/\\]src[/\\]binding.dart:[0-9]+:[0-9]+\)
|
||||
#[0-9]+ +.+ \(package:flutter_test[/\\]src[/\\]binding.dart:[0-9]+:[0-9]+\)
|
||||
#[0-9]+ +.+ \(package:flutter_test[/\\]src[/\\]binding.dart:[0-9]+:[0-9]+\)
|
||||
#[0-9]+ +.+ \(package:flutter_test[/\\]src[/\\]widget_tester\.dart:[0-9]+:[0-9]+\)
|
||||
<<skip until matching line>>
|
||||
^\(elided [0-9]+ .+\)$
|
||||
|
||||
@@ -14,7 +14,10 @@ class TestTestBinding extends AutomatedTestWidgetsFlutterBinding {
|
||||
|
||||
Future<Null> guardedHelper(WidgetTester tester) {
|
||||
return TestAsyncUtils.guard(() async {
|
||||
await tester.pumpWidget(const Text('Hello'));
|
||||
await tester.pumpWidget(const Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: const Text('Hello'),
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -767,6 +767,12 @@ class AutomatedTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
|
||||
});
|
||||
|
||||
return new Future<Null>.microtask(() async {
|
||||
// Run all queued microtasks.
|
||||
await new Future<Null>.microtask(() {});
|
||||
// When the test had an exception, the test-framework already
|
||||
// ran the teardown functions, removing the _fakeAsync function.
|
||||
if (_fakeAsync == null)
|
||||
return null;
|
||||
// Resolve interplay between fake async and real async calls.
|
||||
_fakeAsync.flushMicrotasks();
|
||||
while (_pendingAsyncTasks != null) {
|
||||
|
||||
@@ -120,6 +120,7 @@ class KernelCompiler {
|
||||
'--sdk-root',
|
||||
sdkRoot,
|
||||
'--strong',
|
||||
'--sync-async',
|
||||
'--target=flutter',
|
||||
];
|
||||
if (trackWidgetCreation)
|
||||
@@ -252,6 +253,7 @@ class ResidentCompiler {
|
||||
_sdkRoot,
|
||||
'--incremental',
|
||||
'--strong',
|
||||
'--sync-async',
|
||||
'--target=flutter',
|
||||
];
|
||||
if (outputPath != null) {
|
||||
|
||||
Reference in New Issue
Block a user