Skip to content

Commit c7dd641

Browse files
authored
Remove RepaintBoundary that is no longer needed. (#159232)
Closes flutter/flutter#66006. From what I can tell in the multi-view effort a variation of flutter/flutter#88609 already landed, meaning that the current device-pixel-ratio is being used (as the tests in #88609 are now passing), and I believe that means we can remove the override/hack. Will rely on "Google Testing" to run a TGP internally, or do so myself if necessary.
1 parent d1e2c5f commit c7dd641

3 files changed

Lines changed: 8 additions & 11 deletions

File tree

packages/flutter_test/test/bindings_test.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ void main() {
3030
final Matrix4 matrix = TestViewConfiguration(size: Size.zero).toMatrix();
3131
expect(matrix.storage.every((double x) => x.isFinite), isTrue);
3232
});
33+
34+
test('sets the DPR to match the window', () {
35+
final TestViewConfiguration configuration = TestViewConfiguration(size: const Size(1280.0, 800.0));
36+
expect(configuration.devicePixelRatio, binding.window.devicePixelRatio);
37+
});
3338
});
3439

3540
group(AutomatedTestWidgetsFlutterBinding, () {

packages/integration_test/lib/integration_test.dart

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,6 @@ https://docs.flutter.dev/testing/integration-tests
446446
@override
447447
Timeout defaultTestTimeout = Timeout.none;
448448

449-
@override
450-
Widget wrapWithDefaultView(Widget rootWidget) {
451-
// This is a workaround where screenshots of root widgets have incorrect
452-
// bounds.
453-
// TODO(jiahaog): Remove when https://github.com/flutter/flutter/issues/66006 is fixed.
454-
return super.wrapWithDefaultView(RepaintBoundary(child: rootWidget));
455-
}
456-
457449
@override
458450
void reportExceptionNoticed(FlutterErrorDetails exception) {
459451
// This method is called to log errors as they happen, and they will also

packages/integration_test/test/binding_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ Future<void> main() async {
124124
});
125125
});
126126

127-
// TODO(jiahaog): Remove when https://github.com/flutter/flutter/issues/66006 is fixed.
128-
testWidgets('root widgets are wrapped with a RepaintBoundary', (WidgetTester tester) async {
127+
// Regression test for https://github.com/flutter/flutter/issues/66006.
128+
testWidgets('root view reports correct dimensions', (WidgetTester tester) async {
129129
await tester.pumpWidget(const Placeholder());
130130

131-
expect(find.byType(RepaintBoundary), findsOneWidget);
131+
expect(tester.binding.renderView.paintBounds, const Rect.fromLTWH(0, 0, 2400, 1800));
132132
});
133133

134134
testWidgets('integration test has no label', (WidgetTester tester) async {

0 commit comments

Comments
 (0)