Fix error when resetting configurations in tear down phase (#114468)
* move _verifyInvariants * fix * fix (mimic import test_api.dart) * fix * Update binding.dart * add tests * try to move * Revert "try to move" This reverts commit d3c466d226cc1abe195af83a2630c70f08e25d7d. * Update binding.dart
This commit is contained in:
@@ -12,6 +12,7 @@ library;
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
@@ -102,4 +103,16 @@ void main() {
|
||||
});
|
||||
expect(responded, true);
|
||||
});
|
||||
|
||||
group('should be able to reset values in either tearDown or end of function', () {
|
||||
testWidgets('addTearDown should work', (WidgetTester tester) async {
|
||||
timeDilation = 2;
|
||||
addTearDown(() => timeDilation = 1);
|
||||
});
|
||||
|
||||
testWidgets('directly reset should work', (WidgetTester tester) async {
|
||||
timeDilation = 2;
|
||||
timeDilation = 1;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user