update Scene.toImageSync test to use proper bounds in the request (flutter/engine#37638)

This commit is contained in:
Jim Graham 2022-11-15 12:59:18 -08:00 committed by GitHub
parent 14ce910051
commit 87e6c95c55

View File

@ -42,16 +42,16 @@ void main() {
builder.addTexture(0, width: 10, height: 10);
final Scene scene = builder.build();
final Image image = scene.toImageSync(10, 10);
final Image image = scene.toImageSync(20, 20);
scene.dispose();
expect(image.width, 10);
expect(image.height, 10);
expect(image.width, 20);
expect(image.height, 20);
final ByteData? data = await image.toByteData();
expect(data, isNotNull);
expect(data!.lengthInBytes, 10 * 10 * 4);
expect(data!.lengthInBytes, 20 * 20 * 4);
expect(data.buffer.asUint8List()[0], 0);
expect(data.buffer.asUint8List()[1], 0);
expect(data.buffer.asUint8List()[2], 0);