Skip to content

Commit

Permalink
[web:canvaskit] test zero font size (flutter#37916)
Browse files Browse the repository at this point in the history
* [web:canvaskit] test zero font size

* Noop change to trigger golden uploads

Co-authored-by: Mouad Debbar <[email protected]>
  • Loading branch information
yjbanov and mdebbar authored Dec 6, 2022
1 parent 143977b commit 9554754
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/web_ui/test/canvaskit/canvas_golden_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,22 @@ void testMain() {
await testTextStyle('font size', fontSize: 24);
});

// A regression test for the special case when CanvasKit would default to
// a positive font size when Flutter specifies zero.
//
// See: https://github.com/flutter/flutter/issues/98248
test('text styles - zero font size', () async {
// This only sets the inner text style, but not the paragraph style, so
// "Hello" should be visible, but "World!" should disappear.
await testTextStyle('zero font size', fontSize: 0);

// This sets the paragraph font size to zero, but the inner text gets
// an explicit non-zero size that should override paragraph properties,
// so this time "Hello" should disappear, but "World!" should still be
// visible.
await testTextStyle('zero paragraph font size', paragraphFontSize: 0, fontSize: 14);
});

test('text styles - letter spacing', () async {
await testTextStyle('letter spacing', letterSpacing: 5);
});
Expand Down

0 comments on commit 9554754

Please sign in to comment.