@@ -171,9 +171,14 @@ void main() {
171
171
// 1. exit
172
172
// 2. showPerformanceOverlay
173
173
const int disabledExtensions = kIsWeb ? 2 : 0 ;
174
- // If you add a service extension... TEST IT! :-)
175
- // ...then increment this number.
176
- expect (binding.extensions.length, 35 + widgetInspectorExtensionCount - disabledExtensions);
174
+
175
+ // The expected number of registered service extensions in the Flutter
176
+ // framework, excluding any that are for the widget inspector
177
+ // (see widget_inspector_test.dart for tests of the ext.flutter.inspector
178
+ // service extensions).
179
+ const int serviceExtensionCount = 36 ;
180
+
181
+ expect (binding.extensions.length, serviceExtensionCount + widgetInspectorExtensionCount - disabledExtensions);
177
182
178
183
expect (console, isEmpty);
179
184
debugPrint = debugPrintThrottled;
@@ -442,6 +447,35 @@ void main() {
442
447
expect (binding.frameScheduled, isFalse);
443
448
});
444
449
450
+ test ('Service extensions - profileUserWidgetBuilds' , () async {
451
+ Map <String , dynamic > result;
452
+
453
+ expect (binding.frameScheduled, isFalse);
454
+ expect (debugProfileBuildsEnabledUserWidgets, false );
455
+
456
+ result = await binding.testExtension ('profileUserWidgetBuilds' , < String , String > {});
457
+ expect (result, < String , String > {'enabled' : 'false' });
458
+ expect (debugProfileBuildsEnabledUserWidgets, false );
459
+
460
+ result = await binding.testExtension ('profileUserWidgetBuilds' , < String , String > {'enabled' : 'true' });
461
+ expect (result, < String , String > {'enabled' : 'true' });
462
+ expect (debugProfileBuildsEnabledUserWidgets, true );
463
+
464
+ result = await binding.testExtension ('profileUserWidgetBuilds' , < String , String > {});
465
+ expect (result, < String , String > {'enabled' : 'true' });
466
+ expect (debugProfileBuildsEnabledUserWidgets, true );
467
+
468
+ result = await binding.testExtension ('profileUserWidgetBuilds' , < String , String > {'enabled' : 'false' });
469
+ expect (result, < String , String > {'enabled' : 'false' });
470
+ expect (debugProfileBuildsEnabledUserWidgets, false );
471
+
472
+ result = await binding.testExtension ('profileUserWidgetBuilds' , < String , String > {});
473
+ expect (result, < String , String > {'enabled' : 'false' });
474
+ expect (debugProfileBuildsEnabledUserWidgets, false );
475
+
476
+ expect (binding.frameScheduled, isFalse);
477
+ });
478
+
445
479
test ('Service extensions - profileRenderObjectPaints' , () async {
446
480
Map <String , dynamic > result;
447
481
0 commit comments