From 0dd471976cfc026a6adafee35c6c0a78ae739016 Mon Sep 17 00:00:00 2001 From: Kirpal Demian Date: Thu, 27 Oct 2022 14:05:05 -0400 Subject: [PATCH] fix: properly clear window size overrides after test run (#81) --- lib/src/golden_test_runner.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/golden_test_runner.dart b/lib/src/golden_test_runner.dart index d8b8dc1..77758ce 100644 --- a/lib/src/golden_test_runner.dart +++ b/lib/src/golden_test_runner.dart @@ -71,7 +71,6 @@ class FlutterGoldenTestRunner extends GoldenTestRunner { final childKey = FlutterGoldenTestAdapter.childKey; - final originalSize = tester.binding.window.physicalSize; final mementoDebugDisableShadows = debugDisableShadows; debugDisableShadows = !renderShadows; @@ -115,8 +114,9 @@ class FlutterGoldenTestRunner extends GoldenTestRunner { } finally { debugDisableShadows = mementoDebugDisableShadows; - await tester.binding.setSurfaceSize(originalSize); - tester.binding.window.physicalSizeTestValue = originalSize; + await tester.binding.setSurfaceSize(null); + tester.binding.window.clearPhysicalSizeTestValue(); + tester.binding.window.clearDevicePixelRatioTestValue(); } } }