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