diff --git a/bin/internal/goldens.version b/bin/internal/goldens.version index 84b560f664..aefc18f4e9 100644 --- a/bin/internal/goldens.version +++ b/bin/internal/goldens.version @@ -1 +1 @@ -7e3f945a906f9f1ffdcb1edba870f4533d2c2b86 +02905560cf2c2132a7adea10943001f29325f3be diff --git a/packages/flutter/test/widgets/text_golden_test.dart b/packages/flutter/test/widgets/text_golden_test.dart index 6d99f304f9..b90d7ffa7a 100644 --- a/packages/flutter/test/widgets/text_golden_test.dart +++ b/packages/flutter/test/widgets/text_golden_test.dart @@ -135,6 +135,56 @@ void main() { ); }, skip: !Platform.isLinux); + // TODO(garyq): This test requires an update when the background + // drawing from the beginning of the line bug is fixed. The current + // tested version is not completely correct. + testWidgets('Text Background', (WidgetTester tester) async { + const Color red = Colors.red; + const Color blue = Colors.blue; + const Color translucentGreen = Color(0x5000F000); + const Color translucentDarkRed = Color(0x500F0000); + await tester.pumpWidget( + Align( + alignment: Alignment.topLeft, + child: RepaintBoundary( + child: Container( + width: 200.0, + height: 100.0, + decoration: const BoxDecoration( + color: Colors.green, + ), + child: RichText( + textDirection: TextDirection.ltr, + text: TextSpan( + text: 'text1 ', + style: TextStyle( + color: translucentGreen, + background: Paint() + ..color = red.withOpacity(0.5) + ), + children: [ + TextSpan( + text: 'text2', + style: TextStyle( + color: translucentDarkRed, + background: Paint() + ..color = blue.withOpacity(0.5) + ) + ), + ], + ), + ), + ), + ), + ), + ); + + await expectLater( + find.byType(RepaintBoundary), + matchesGoldenFile('text_golden.Background.png'), + ); + }, skip: !Platform.isLinux); + testWidgets('Text Fade', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp(