mirror of
https://github.com/flutter/flutter
synced 2024-09-29 04:54:17 +00:00
Do not paint a description label when rendering an integration test (#153875)
Fixes https://github.com/flutter/flutter/issues/153624
This commit is contained in:
parent
05c454c28c
commit
9bf7d7bb35
|
@ -1832,7 +1832,13 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
|
|||
fontSize: 10.0,
|
||||
);
|
||||
|
||||
void _setDescription(String value) {
|
||||
/// Label describing the test.
|
||||
@visibleForTesting
|
||||
TextPainter? get label => _label;
|
||||
|
||||
/// Set a description label that is drawn into the test output.
|
||||
@protected
|
||||
void setLabel(String value) {
|
||||
if (value.isEmpty) {
|
||||
_label = null;
|
||||
return;
|
||||
|
@ -2033,7 +2039,7 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
|
|||
}) {
|
||||
assert(!inTest);
|
||||
_inTest = true;
|
||||
_setDescription(description);
|
||||
setLabel(description);
|
||||
return _runTest(testBody, invariantTester, description);
|
||||
}
|
||||
|
||||
|
|
|
@ -244,6 +244,11 @@ https://docs.flutter.dev/testing/integration-tests
|
|||
results[description] ??= _success;
|
||||
}
|
||||
|
||||
// Do not paint a description label because it could show up in screenshots
|
||||
// of the integration test.
|
||||
@override
|
||||
void setLabel(String value) {}
|
||||
|
||||
vm.VmService? _vmService;
|
||||
|
||||
/// Initialize the [vm.VmService] settings for the timeline.
|
||||
|
|
|
@ -130,6 +130,10 @@ Future<void> main() async {
|
|||
|
||||
expect(find.byType(RepaintBoundary), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('integration test has no label', (WidgetTester tester) async {
|
||||
expect(binding.label, null);
|
||||
});
|
||||
});
|
||||
|
||||
tearDownAll(() async {
|
||||
|
|
Loading…
Reference in a new issue