Unverified Commit c2bfb7b3 authored by Jia Hao's avatar Jia Hao Committed by GitHub

[integration_test] Wrap pumped widgets with a RepaintBoundary (#70368)

parent 135a8c22
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment