Skip to content

Commit 5a3957f

Browse files
authored
1 parent ba46cb8 commit 5a3957f

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

packages/flutter_test/lib/src/binding.dart

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import 'package:flutter/services.dart';
1515
import 'package:flutter/widgets.dart';
1616
import 'package:stack_trace/stack_trace.dart' as stack_trace;
1717
import 'package:test_api/expect.dart' show fail;
18-
import 'package:test_api/scaffolding.dart'; // ignore: deprecated_member_use
1918
import 'package:test_api/test_api.dart' as test_package show Timeout; // ignore: deprecated_member_use
2019
import 'package:vector_math/vector_math_64.dart';
2120

@@ -920,13 +919,6 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
920919
// So that we can assert that it remains the same after the test finishes.
921920
_beforeTestCheckIntrinsicSizes = debugCheckIntrinsicSizes;
922921

923-
bool shouldTearDownVerifyInvariants = false;
924-
addTearDown(() {
925-
if (shouldTearDownVerifyInvariants) {
926-
_verifyTearDownInvariants();
927-
}
928-
});
929-
930922
runApp(Container(key: UniqueKey(), child: _preTestMessage)); // Reset the tree to a known state.
931923
await pump();
932924
// Pretend that the first frame produced in the test body is the first frame
@@ -957,7 +949,6 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
957949
_verifyErrorWidgetBuilderUnset(errorWidgetBuilderBeforeTest);
958950
_verifyShouldPropagateDevicePointerEventsUnset(shouldPropagateDevicePointerEventsBeforeTest);
959951
_verifyInvariants();
960-
shouldTearDownVerifyInvariants = true;
961952
}
962953

963954
assert(inTest);
@@ -967,11 +958,6 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
967958
late bool _beforeTestCheckIntrinsicSizes;
968959

969960
void _verifyInvariants() {
970-
// subclasses such as AutomatedTestWidgetsFlutterBinding overrides this
971-
// to perform more verifications.
972-
}
973-
974-
void _verifyTearDownInvariants() {
975961
assert(debugAssertNoTransientCallbacks(
976962
'An animation is still running even after the widget tree was disposed.'
977963
));

packages/flutter_test/test/bindings_test.dart

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ library;
1212
import 'dart:async';
1313
import 'dart:io';
1414

15-
import 'package:flutter/scheduler.dart';
1615
import 'package:flutter/services.dart';
1716
import 'package:flutter/widgets.dart';
1817
import 'package:flutter_test/flutter_test.dart';
@@ -103,16 +102,4 @@ void main() {
103102
});
104103
expect(responded, true);
105104
});
106-
107-
group('should be able to reset values in either tearDown or end of function', () {
108-
testWidgets('addTearDown should work', (WidgetTester tester) async {
109-
timeDilation = 2;
110-
addTearDown(() => timeDilation = 1);
111-
});
112-
113-
testWidgets('directly reset should work', (WidgetTester tester) async {
114-
timeDilation = 2;
115-
timeDilation = 1;
116-
});
117-
});
118105
}

0 commit comments

Comments
 (0)