Fix bug thattimeDilation is not reset, causing subsequent test errors, and add verifications to ensure such problem does not exist in the future (#113830)

This commit is contained in:
fzyzcjy
2022-11-02 06:50:00 +08:00
committed by GitHub
parent c23b5ca7db
commit 61deaef5df
6 changed files with 40 additions and 0 deletions

View File

@@ -119,6 +119,7 @@ Future<File> generateTest(Directory apiDir) async {
// Collect the examples, and import them all as separate symbols.
final List<String> imports = <String>[];
imports.add('''import 'package:flutter/widgets.dart';''');
imports.add('''import 'package:flutter/scheduler.dart';''');
imports.add('''import 'package:flutter_test/flutter_test.dart';''');
imports.add('''import 'package:integration_test/integration_test.dart';''');
final List<ExampleInfo> infoList = <ExampleInfo>[];
@@ -165,6 +166,7 @@ void main() {
expect(find.byType(WidgetsApp), findsOneWidget);
} finally {
ErrorWidget.builder = originalBuilder;
timeDilation = 1.0;
}
},
);