1010// reduced-test-set:
1111// This file is run as part of a reduced test set in CI on Mac and Windows
1212// machines.
13- @Tags (< String > ['reduced-test-set' , 'no-shuffle' ])
13+ @Tags (< String > ['reduced-test-set' ])
1414@TestOn ('!chrome' )
1515library ;
1616
@@ -220,6 +220,14 @@ class RepaintBoundaryWithDebugPaint extends RepaintBoundary {
220220 }
221221}
222222
223+ Widget _applyConstructor (Widget Function () constructor) => constructor ();
224+
225+ class _TrivialWidget extends StatelessWidget {
226+ const _TrivialWidget () : super (key: const Key ('singleton' ));
227+ @override
228+ Widget build (BuildContext context) => const Text ('Hello, world!' );
229+ }
230+
223231int getChildLayerCount (OffsetLayer layer) {
224232 Layer ? child = layer.firstChild;
225233 int count = 0 ;
@@ -240,8 +248,15 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
240248 final TestWidgetInspectorService service = TestWidgetInspectorService ();
241249 WidgetInspectorService .instance = service;
242250
243- tearDown (() {
251+ tearDown (() async {
244252 service.resetAllState ();
253+
254+ if (WidgetInspectorService .instance.isWidgetCreationTracked ()) {
255+ await service.testBoolExtension (
256+ WidgetInspectorServiceExtensions .trackRebuildDirtyWidgets.name,
257+ < String , String > {'enabled' : 'false' },
258+ );
259+ }
245260 });
246261
247262 testWidgets ('WidgetInspector smoke test' , (WidgetTester tester) async {
@@ -3586,6 +3601,28 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
35863601 skip: ! WidgetInspectorService .instance.isWidgetCreationTracked (), // [intended] Test requires --track-widget-creation flag.
35873602 );
35883603
3604+ testWidgets ('ext.flutter.inspector.trackRebuildDirtyWidgets with tear-offs' , (WidgetTester tester) async {
3605+ final Widget widget = Directionality (
3606+ textDirection: TextDirection .ltr,
3607+ child: WidgetInspector (
3608+ selectButtonBuilder: null ,
3609+ child: _applyConstructor (_TrivialWidget .new ),
3610+ ),
3611+ );
3612+
3613+ expect (
3614+ await service.testBoolExtension (
3615+ WidgetInspectorServiceExtensions .trackRebuildDirtyWidgets.name,
3616+ < String , String > {'enabled' : 'true' },
3617+ ),
3618+ equals ('true' ),
3619+ );
3620+
3621+ await tester.pumpWidget (widget);
3622+ },
3623+ skip: ! WidgetInspectorService .instance.isWidgetCreationTracked (), // [intended] Test requires --track-widget-creation flag.
3624+ );
3625+
35893626 testWidgets ('ext.flutter.inspector.trackRebuildDirtyWidgets' , (WidgetTester tester) async {
35903627 service.rebuildCount = 0 ;
35913628
0 commit comments