From 441fb4562c4392675d43514d682b021032a5ee1e Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Thu, 18 Jul 2024 10:47:05 -0700 Subject: [PATCH] Fix race in image_filter_test.dart (flutter/engine#53996) Fixes https://github.com/flutter/flutter/issues/151973 --- engine/src/flutter/testing/dart/image_filter_test.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/testing/dart/image_filter_test.dart b/engine/src/flutter/testing/dart/image_filter_test.dart index 100d198947..0200d6f2d4 100644 --- a/engine/src/flutter/testing/dart/image_filter_test.dart +++ b/engine/src/flutter/testing/dart/image_filter_test.dart @@ -43,7 +43,7 @@ const List halvesBrightnessColorMatrix = [ 0, 0, 0, 1, 0, ]; -void main() { +void main() async { Future getBytesForPaint(Paint paint, {int width = 3, int height = 3}) async { final PictureRecorder recorder = PictureRecorder(); final Canvas recorderCanvas = Canvas(recorder); @@ -302,8 +302,6 @@ void main() { // Tests that FilterQuality. produces the expected golden file. group('ImageFilter|FilterQuality', () async { - final ImageComparer comparer = await ImageComparer.create(); - /// Draw a red-green checkerboard pattern with 1x1 squares (pixels). Future drawCheckerboard({ int width = 100, @@ -354,6 +352,7 @@ void main() { } test('Scaling a checkerboard of 1x1 red-green pixels with FilterQuality.none', () async { + final ImageComparer comparer = await ImageComparer.create(); final Image base = await redGreenCheckerboard; final Image scaled = await shrinkAndScaleImage(base, FilterQuality.none); await comparer.addGoldenImage(scaled, 'dart_ui_filter_quality_none_scale_1x1_red_green_checkerboard.png');