Unverified Commit e22e8f25 authored by pdblasi-google's avatar pdblasi-google Committed by GitHub

Updates `integration_test` to no longer use `TestWindow` (#122358)

Updates `integration_test` to no longer use `TestWindow`
parent 7ba1d5ec
......@@ -77,15 +77,15 @@ Future<void> main() async {
testWidgets('setSurfaceSize works', (WidgetTester tester) async {
await tester.pumpWidget(const MaterialApp(home: Center(child: Text('Test'))));
final Size windowCenter = tester.binding.window.physicalSize /
tester.binding.window.devicePixelRatio /
final Size viewCenter = tester.view.physicalSize /
tester.view.devicePixelRatio /
2;
final double windowCenterX = windowCenter.width;
final double windowCenterY = windowCenter.height;
final double viewCenterX = viewCenter.width;
final double viewCenterY = viewCenter.height;
Offset widgetCenter = tester.getRect(find.byType(Text)).center;
expect(widgetCenter.dx, windowCenterX);
expect(widgetCenter.dy, windowCenterY);
expect(widgetCenter.dx, viewCenterX);
expect(widgetCenter.dy, viewCenterY);
await tester.binding.setSurfaceSize(const Size(200, 300));
await tester.pump();
......@@ -96,8 +96,8 @@ Future<void> main() async {
await tester.binding.setSurfaceSize(null);
await tester.pump();
widgetCenter = tester.getRect(find.byType(Text)).center;
expect(widgetCenter.dx, windowCenterX);
expect(widgetCenter.dy, windowCenterY);
expect(widgetCenter.dx, viewCenterX);
expect(widgetCenter.dy, viewCenterY);
});
testWidgets('Test traceAction', (WidgetTester tester) 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