Ensure all golden filenames end in .png. (flutter/engine#40604)
Ensure all golden filenames end in .png.
This commit is contained in:
@@ -56,7 +56,7 @@ void testMain() {
|
||||
canvas.drawParagraph(paragraph, const ui.Offset(10, 10));
|
||||
final CkPicture picture = recorder.endRecording();
|
||||
await matchPictureGolden(
|
||||
'font_variation.jpg',
|
||||
'font_variation.png',
|
||||
picture,
|
||||
region: ui.Rect.fromLTRB(0, 0, testWidth, paragraph.height + 20),
|
||||
);
|
||||
|
||||
@@ -779,7 +779,7 @@ void _testForImageCodecs({required bool useBrowserImageDecoder}) {
|
||||
}
|
||||
CanvasKitRenderer.instance.rasterizer.draw(sb.build().layerTree);
|
||||
await matchGoldenFile(
|
||||
'canvaskit_picture_texture_toimage',
|
||||
'canvaskit_picture_texture_toimage.png',
|
||||
region: const ui.Rect.fromLTRB(0, 0, 128, 128),
|
||||
);
|
||||
mandrill.dispose();
|
||||
|
||||
@@ -49,6 +49,9 @@ enum PixelComparison {
|
||||
/// [pixelComparison] determines the algorithm used to compare pixels. Uses
|
||||
/// fuzzy comparison by default.
|
||||
Future<void> matchGoldenFile(String filename, {Rect? region}) async {
|
||||
if (!filename.endsWith('.png')) {
|
||||
throw ArgumentError('Filename must end in .png or SkiaGold will ignore it.');
|
||||
}
|
||||
final Map<String, dynamic> serverParams = <String, dynamic>{
|
||||
'filename': filename,
|
||||
'region': region == null
|
||||
|
||||
Reference in New Issue
Block a user