[integration_test] Wrap pumped widgets with a RepaintBoundary (#70368)
This commit is contained in:
parent
135a8c22b1
commit
c2bfb7b348
@ -412,4 +412,12 @@ class IntegrationTestWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding
|
||||
/// See [TestWidgetsFlutterBinding.defaultTestTimeout] for more details.
|
||||
set defaultTestTimeout(Timeout timeout) => _defaultTestTimeout = timeout;
|
||||
Timeout _defaultTestTimeout;
|
||||
|
||||
@override
|
||||
void attachRootWidget(Widget rootWidget) {
|
||||
// This is a workaround where screenshots of root widgets have incorrect
|
||||
// bounds.
|
||||
// TODO(jiahaog): Remove when https://github.com/flutter/flutter/issues/66006 is fixed.
|
||||
super.attachRootWidget(RepaintBoundary(child: rootWidget));
|
||||
}
|
||||
}
|
||||
|
@ -100,6 +100,13 @@ Future<void> main() async {
|
||||
expect(integrationBinding.defaultTestTimeout, newTimeout);
|
||||
});
|
||||
});
|
||||
|
||||
// TODO(jiahaog): Remove when https://github.com/flutter/flutter/issues/66006 is fixed.
|
||||
testWidgets('root widgets are wrapped with a RepaintBoundary', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const Placeholder());
|
||||
|
||||
expect(find.byType(RepaintBoundary), findsOneWidget);
|
||||
});
|
||||
});
|
||||
|
||||
tearDownAll(() async {
|
||||
|
Loading…
x
Reference in New Issue
Block a user