@@ -56,32 +56,36 @@ void testMain() {
5656 expect (boxes.single.direction, equals (ui.TextDirection .ltr));
5757 });
5858
59- test ('Renders tab as space instead of tofu' , () async {
60- // Skia renders a tofu if the font does not have a glyph for a
61- // character. However, Flutter opts-in to a Skia feature to render
62- // tabs as a single space.
63- // See: https://github.com/flutter/flutter/issues/79153
64- Future <ui.Image > drawText (String text) {
65- const bounds = ui.Rect .fromLTRB (0 , 0 , 100 , 100 );
66- final recorder = ui.PictureRecorder ();
67- final canvas = ui.Canvas (recorder, bounds);
68- final ui.Paragraph paragraph = makeSimpleText (text);
59+ test (
60+ 'Renders tab as space instead of tofu' ,
61+ () async {
62+ // Skia renders a tofu if the font does not have a glyph for a
63+ // character. However, Flutter opts-in to a Skia feature to render
64+ // tabs as a single space.
65+ // See: https://github.com/flutter/flutter/issues/79153
66+ Future <ui.Image > drawText (String text) {
67+ const bounds = ui.Rect .fromLTRB (0 , 0 , 100 , 100 );
68+ final recorder = ui.PictureRecorder ();
69+ final canvas = ui.Canvas (recorder, bounds);
70+ final ui.Paragraph paragraph = makeSimpleText (text);
6971
70- canvas.drawParagraph (paragraph, ui.Offset .zero);
71- final ui.Picture picture = recorder.endRecording ();
72- return picture.toImage (100 , 100 );
73- }
72+ canvas.drawParagraph (paragraph, ui.Offset .zero);
73+ final ui.Picture picture = recorder.endRecording ();
74+ return picture.toImage (100 , 100 );
75+ }
7476
75- // The backspace character, \b, does not have a corresponding glyph and
76- // is rendered as a tofu.
77- final ui.Image tabImage = await drawText ('>\t <' );
78- final ui.Image spaceImage = await drawText ('> <' );
79- final ui.Image tofuImage = await drawText ('>\b <' );
77+ // The backspace character, \b, does not have a corresponding glyph and
78+ // is rendered as a tofu.
79+ final ui.Image tabImage = await drawText ('>\t <' );
80+ final ui.Image spaceImage = await drawText ('> <' );
81+ final ui.Image tofuImage = await drawText ('>\b <' );
8082
81- expect (await matchImage (tabImage, spaceImage), isTrue);
82- expect (await matchImage (tabImage, tofuImage), isFalse);
83- }, skip: isSafari || isFirefox); // https://github.com/flutter/flutter/issues/175371
84- // TODO(hterkelsen): https://github.com/flutter/flutter/issues/71520
83+ expect (await matchImage (tabImage, spaceImage), isTrue);
84+ expect (await matchImage (tabImage, tofuImage), isFalse);
85+ },
86+ skip: isWimp || isSafari || isFirefox,
87+ ); // TODO(hterkelsen): https://github.com/flutter/flutter/issues/71520
88+ // TODO(jacksongardner): https://github.com/flutter/flutter/issues/183944
8589 }, skip: isSafari || isFirefox);
8690}
8791
0 commit comments