mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
update Scene.toImageSync test to use proper bounds in the request (flutter/engine#37638)
This commit is contained in:
parent
14ce910051
commit
87e6c95c55
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user