Reland (3): Removes single window assumptions from flutter_test (#122422)

Reland (3): Removes single window assumptions from `flutter_test`
This commit is contained in:
pdblasi-google
2023-03-13 14:50:24 -07:00
committed by GitHub
parent 37fc9ed260
commit 7dd53fefe9
16 changed files with 2404 additions and 1283 deletions

View File

@@ -711,6 +711,25 @@ void main() {
});
});
testWidgets('platformDispatcher exposes the platformDispatcher from binding', (WidgetTester tester) async {
expect(tester.platformDispatcher, tester.binding.platformDispatcher);
});
testWidgets('view exposes the implicitView from platformDispatcher', (WidgetTester tester) async {
expect(tester.view, tester.platformDispatcher.implicitView);
});
testWidgets('viewOf finds a view when the view is implicit', (WidgetTester tester) async {
await tester.pumpWidget(const MaterialApp(
home: Center(
child: Text('Test'),
)
));
expect(() => tester.viewOf(find.text('Test')), isNot(throwsA(anything)));
expect(tester.viewOf(find.text('Test')), isA<TestFlutterView>());
});
group('SemanticsController', () {
group('find', () {
testWidgets('throws when there are no semantics', (WidgetTester tester) async {