Skip to content

Commit c7ea3ca

Browse files
authored
Revert sync async (#18002)
1 parent 0e8164b commit c7ea3ca

File tree

5 files changed

+2
-62
lines changed

5 files changed

+2
-62
lines changed

dev/automated_tests/flutter_test/exception_handling_expectation.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ Who lives, who dies, who tells your story\?
4343

4444
When the exception was thrown, this was the stack:
4545
#[0-9]+ +main.<anonymous closure> \(.+[/\\]dev[/\\]automated_tests[/\\]flutter_test[/\\]exception_handling_test\.dart:16:9\)
46-
#[0-9]+ +.+ \(package:flutter_test[/\\]src[/\\]binding.dart:[0-9]+:[0-9]+\)
47-
#[0-9]+ +.+ \(package:flutter_test[/\\]src[/\\]binding.dart:[0-9]+:[0-9]+\)
48-
#[0-9]+ +.+ \(package:flutter_test[/\\]src[/\\]binding.dart:[0-9]+:[0-9]+\)
49-
#[0-9]+ +.+ \(package:flutter_test[/\\]src[/\\]binding.dart:[0-9]+:[0-9]+\)
46+
#[0-9]+ +main.<anonymous closure> \(.+[/\\]dev[/\\]automated_tests[/\\]flutter_test[/\\]exception_handling_test\.dart:15:77\)
5047
#[0-9]+ +.+ \(package:flutter_test[/\\]src[/\\]widget_tester\.dart:[0-9]+:[0-9]+\)
5148
<<skip until matching line>>
5249
^\(elided [0-9]+ .+\)$

dev/automated_tests/flutter_test/test_async_utils_guarded_test.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ class TestTestBinding extends AutomatedTestWidgetsFlutterBinding {
1414

1515
Future<Null> guardedHelper(WidgetTester tester) {
1616
return TestAsyncUtils.guard(() async {
17-
await tester.pumpWidget(const Directionality(
18-
textDirection: TextDirection.ltr,
19-
child: const Text('Hello'),
20-
));
17+
await tester.pumpWidget(const Text('Hello'));
2118
});
2219
}
2320

packages/flutter/test/engine/dart_test.dart

Lines changed: 0 additions & 26 deletions
This file was deleted.

packages/flutter_test/lib/src/binding.dart

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -490,12 +490,6 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
490490
}
491491

492492
Future<Null> _runTestBody(Future<Null> testBody(), VoidCallback invariantTester) async {
493-
// Delay this function by a microtask.
494-
// Otherwise it will open a scope immediately, which is then open when
495-
// the `asyncBarrier` is invoked. The `asyncBarrier` is immediately
496-
// following the call to `testZone.runBinary(_runTestBody)`, so delaying
497-
// by one microtask is enough to ensure that the timing is correct.
498-
await new Future<Null>.microtask(() {});
499493
assert(inTest);
500494

501495
runApp(new Container(key: new UniqueKey(), child: _preTestMessage)); // Reset the tree to a known state.
@@ -773,12 +767,6 @@ class AutomatedTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
773767
});
774768

775769
return new Future<Null>.microtask(() async {
776-
// Run all queued microtasks.
777-
await new Future<Null>.microtask(() {});
778-
// When the test had an exception, the test-framework already
779-
// ran the teardown functions, removing the _fakeAsync function.
780-
if (_fakeAsync == null)
781-
return null;
782770
// Resolve interplay between fake async and real async calls.
783771
_fakeAsync.flushMicrotasks();
784772
while (_pendingAsyncTasks != null) {
@@ -995,13 +983,6 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
995983

996984
@override
997985
void handleBeginFrame(Duration rawTimeStamp) {
998-
// Don't run this function when `handleBeginFrame` was invoked
999-
// immediately before without a call of `handleDrawFrame` in between.
1000-
// TODO(floitsch): Remove this line when the spurious calls from the
1001-
// framework don't happen anymore. See
1002-
// https://github.com/flutter/flutter/issues/17963
1003-
if (_doDrawThisFrame != null)
1004-
return;
1005986
assert(_doDrawThisFrame == null);
1006987
if (_expectingFrame ||
1007988
(framePolicy == LiveTestWidgetsFlutterBindingFramePolicy.fullyLive) ||
@@ -1016,13 +997,6 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
1016997

1017998
@override
1018999
void handleDrawFrame() {
1019-
// Don't run this function when `handleBeginFrame` wasn't invoked
1020-
// immediately before.
1021-
// TODO(floitsch): Remove this line when the spurious calls from the
1022-
// framework don't happen anymore. See
1023-
// https://github.com/flutter/flutter/issues/17963
1024-
if (_doDrawThisFrame == null)
1025-
return;
10261000
assert(_doDrawThisFrame != null);
10271001
if (_doDrawThisFrame)
10281002
super.handleDrawFrame();

packages/flutter_tools/lib/src/compile.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ class KernelCompiler {
120120
'--sdk-root',
121121
sdkRoot,
122122
'--strong',
123-
'--sync-async',
124123
'--target=flutter',
125124
];
126125
if (trackWidgetCreation)
@@ -253,7 +252,6 @@ class ResidentCompiler {
253252
_sdkRoot,
254253
'--incremental',
255254
'--strong',
256-
'--sync-async',
257255
'--target=flutter',
258256
];
259257
if (outputPath != null) {

0 commit comments

Comments
 (0)