Skip to content

Commit 4a8d42a

Browse files
Disable firefox image_to_byte_data_test as a group. (flutter#166559)
Grouping allows us to avoid running the setup function when the tests are skipped, and the setup function is where it was actually stalling. Skipping as a group seems to avoid this problem. We can turn `bringup: true` off of the web unit tests now.
1 parent 97f5316 commit 4a8d42a

File tree

2 files changed

+32
-34
lines changed

2 files changed

+32
-34
lines changed

engine/src/flutter/.ci.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ targets:
384384
cores: "8"
385385

386386
- name: Linux linux_web_engine_tests
387-
bringup: true # https://github.com/flutter/flutter/issues/165610 - Ubuntu 24.04 + Firefox
388387
recipe: engine_v2/engine_v2
389388
timeout: 120
390389
properties:

engine/src/flutter/lib/web_ui/test/engine/image_to_byte_data_test.dart

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,38 @@ void main() {
1616
}
1717

1818
Future<void> testMain() async {
19-
setUpUnitTests();
20-
21-
Future<Image> createTestImageByColor(Color color) async {
22-
final PictureRecorder recorder = PictureRecorder();
23-
final Canvas canvas = Canvas(recorder, const Rect.fromLTRB(0, 0, 2, 2));
24-
canvas.drawColor(color, BlendMode.srcOver);
25-
final Picture testPicture = recorder.endRecording();
26-
final Image testImage = await testPicture.toImage(2, 2);
27-
return testImage;
28-
}
29-
30-
test('Picture.toImage().toByteData()', () async {
31-
final Image testImage = await createTestImageByColor(const Color(0xFFCCDD00));
32-
33-
final ByteData bytes = (await testImage.toByteData())!;
34-
expect(bytes.buffer.asUint32List(), <int>[0xFF00DDCC, 0xFF00DDCC, 0xFF00DDCC, 0xFF00DDCC]);
35-
36-
final ByteData pngBytes = (await testImage.toByteData(format: ImageByteFormat.png))!;
37-
38-
// PNG-encoding is browser-specific, but the header is standard. We only
39-
// test the header.
40-
final List<int> pngHeader = <int>[137, 80, 78, 71, 13, 10, 26, 10];
41-
expect(pngBytes.buffer.asUint8List().sublist(0, pngHeader.length), pngHeader);
42-
43-
// Firefox does not support WebGL in headless mode.
44-
}, skip: isFirefox);
45-
46-
test('Image.toByteData(format: ImageByteFormat.rawStraightRgba)', () async {
47-
final Image testImage = await createTestImageByColor(const Color(0xAAFFFF00));
48-
49-
final ByteData bytes = (await testImage.toByteData(format: ImageByteFormat.rawStraightRgba))!;
50-
expect(bytes.buffer.asUint32List(), <int>[0xAA00FFFF, 0xAA00FFFF, 0xAA00FFFF, 0xAA00FFFF]);
51-
19+
group('toByteData test', () {
20+
setUpUnitTests();
21+
22+
Future<Image> createTestImageByColor(Color color) async {
23+
final PictureRecorder recorder = PictureRecorder();
24+
final Canvas canvas = Canvas(recorder, const Rect.fromLTRB(0, 0, 2, 2));
25+
canvas.drawColor(color, BlendMode.srcOver);
26+
final Picture testPicture = recorder.endRecording();
27+
final Image testImage = await testPicture.toImage(2, 2);
28+
return testImage;
29+
}
30+
31+
test('Picture.toImage().toByteData()', () async {
32+
final Image testImage = await createTestImageByColor(const Color(0xFFCCDD00));
33+
34+
final ByteData bytes = (await testImage.toByteData())!;
35+
expect(bytes.buffer.asUint32List(), <int>[0xFF00DDCC, 0xFF00DDCC, 0xFF00DDCC, 0xFF00DDCC]);
36+
37+
final ByteData pngBytes = (await testImage.toByteData(format: ImageByteFormat.png))!;
38+
39+
// PNG-encoding is browser-specific, but the header is standard. We only
40+
// test the header.
41+
final List<int> pngHeader = <int>[137, 80, 78, 71, 13, 10, 26, 10];
42+
expect(pngBytes.buffer.asUint8List().sublist(0, pngHeader.length), pngHeader);
43+
});
44+
45+
test('Image.toByteData(format: ImageByteFormat.rawStraightRgba)', () async {
46+
final Image testImage = await createTestImageByColor(const Color(0xAAFFFF00));
47+
48+
final ByteData bytes = (await testImage.toByteData(format: ImageByteFormat.rawStraightRgba))!;
49+
expect(bytes.buffer.asUint32List(), <int>[0xAA00FFFF, 0xAA00FFFF, 0xAA00FFFF, 0xAA00FFFF]);
50+
});
5251
// Firefox does not support WebGL in headless mode.
5352
}, skip: isFirefox);
5453
}

0 commit comments

Comments
 (0)