Skip to content

Commit 3b1ec7b

Browse files
harryterkelsenDanTup
authored andcommitted
[web] Unskip 8 passing image tests in painting and rendering (flutter#193377)
Unskips 8 tests across 3 framework test files that were skipped on web (`skip: kIsWeb`) and now pass on Chrome, both with the default compiler and with `--wasm`: - `packages/flutter/test/painting/decoration_test.dart` (3 skips removed): - Unskips `DecorationImage with null textDirection configuration should throw Error`, skipped for flutter#87364 (diagnostic numbers printing differently on web). - Unskips `DecorationImagePainter releases the placeholder once the image loads` and `DecorationImagePainter disposes of image when disposed`, skipped for flutter#87442 (`Image.debugGetOpenHandleStackTraces()` on web). - `packages/flutter/test/painting/image_cache_test.dart` (2 skips removed): - Unskips `Image is obtained and disposed of properly for cache` and its `when listener is still active` variant, skipped for flutter#87442. - `packages/flutter/test/rendering/image_test.dart` (3 skips removed): - Unskips `RenderImage disposes its image`, `RenderImage does not dispose its image if setting the same image twice`, and `Render image disposes its image when it is disposed`, skipped for flutter#87442. - Removes the `package:flutter/foundation.dart` import, which was only used for `kIsWeb`. Other web skips still reference both issues (`widgets/image_test.dart` for flutter#87442 and `material/app_bar_theme_test.dart` for flutter#87364), so this PR doesn't fully resolve either one. Related issues: - flutter#87364 - flutter#87442 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant in-code documentation (doc comments with `///`). - [x] If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [flutter/website]: https://github.com/flutter/website [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent f65c3af commit 3b1ec7b

3 files changed

Lines changed: 7 additions & 10 deletions

File tree

‎packages/flutter/test/painting/decoration_test.dart‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ void main() {
406406
' The ImageConfiguration was:\n'
407407
' ImageConfiguration(size: Size(100.0, 100.0))\n',
408408
);
409-
}, skip: kIsWeb); // https://github.com/flutter/flutter/issues/87364
409+
});
410410

411411
test('DecorationImage - error listener', () async {
412412
late String exception;
@@ -865,7 +865,7 @@ void main() {
865865
await delayedProvider.complete();
866866
await null;
867867
expect(placeholder.debugGetOpenHandleStackTraces()!.length, handleCountWithPlaceholder - 1);
868-
}, skip: kIsWeb); // https://github.com/flutter/flutter/issues/87442
868+
});
869869

870870
test('DecorationImage placeholder is included in equality and toString', () async {
871871
final ui.Image image = await createTestImage(width: 100, height: 100);
@@ -907,7 +907,7 @@ void main() {
907907
expect(info.image.debugGetOpenHandleStackTraces()!.length, baselineRefCount);
908908

909909
info.dispose();
910-
}, skip: kIsWeb); // https://github.com/flutter/flutter/issues/87442
910+
});
911911

912912
test('BoxShadow.copyWith', () {
913913
expect(const BoxShadow(), isNot(const BoxShadow(color: Color(0xFF112233))));

‎packages/flutter/test/painting/image_cache_test.dart‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import 'dart:ui' as ui;
66

7-
import 'package:flutter/foundation.dart';
87
import 'package:flutter/painting.dart';
98
import 'package:flutter/scheduler.dart';
109
import 'package:flutter_test/flutter_test.dart';
@@ -645,7 +644,7 @@ void main() {
645644

646645
imageInfo.dispose();
647646
expect(testImage.debugGetOpenHandleStackTraces()!.length, 0);
648-
}, skip: kIsWeb); // https://github.com/flutter/flutter/issues/87442
647+
});
649648

650649
test(
651650
'Image is obtained and disposed of properly for cache when listener is still active',
@@ -687,7 +686,6 @@ void main() {
687686
imageInfo.dispose();
688687
expect(testImage.debugGetOpenHandleStackTraces()!.length, 0);
689688
},
690-
skip: kIsWeb, // https://github.com/flutter/flutter/issues/87442
691689
);
692690

693691
test('clear does not leave pending images stuck', () async {

‎packages/flutter/test/rendering/image_test.dart‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import 'dart:ui' as ui show Image;
66

7-
import 'package:flutter/foundation.dart';
87
import 'package:flutter/rendering.dart';
98
import 'package:flutter_test/flutter_test.dart';
109

@@ -242,7 +241,7 @@ Future<void> main() async {
242241

243242
image.dispose();
244243
expect(image.debugGetOpenHandleStackTraces()!.length, 0);
245-
}, skip: kIsWeb); // https://github.com/flutter/flutter/issues/87442
244+
});
246245

247246
test('RenderImage does not dispose its image if setting the same image twice', () async {
248247
final ui.Image image = await createTestImage(width: 10, height: 10, cache: false);
@@ -260,7 +259,7 @@ Future<void> main() async {
260259

261260
image.dispose();
262261
expect(image.debugGetOpenHandleStackTraces()!.length, 0);
263-
}, skip: kIsWeb); // https://github.com/flutter/flutter/issues/87442
262+
});
264263

265264
test('Render image disposes its image when it is disposed', () async {
266265
final ui.Image image = await createTestImage(width: 10, height: 10, cache: false);
@@ -275,5 +274,5 @@ Future<void> main() async {
275274

276275
image.dispose();
277276
expect(image.debugGetOpenHandleStackTraces()!.length, 0);
278-
}, skip: kIsWeb); // https://github.com/flutter/flutter/issues/87442
277+
});
279278
}

0 commit comments

Comments
 (0)