Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
0d087562
Unverified
Commit
0d087562
authored
Apr 15, 2022
by
Kenzie Davisson
Committed by
GitHub
Apr 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Register a service extension for `profileUserWidgetBuilds` (#101989)
parent
3ce2931c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
3 deletions
+45
-3
binding.dart
packages/flutter/lib/src/widgets/binding.dart
+8
-0
service_extensions_test.dart
...ages/flutter/test/foundation/service_extensions_test.dart
+37
-3
No files found.
packages/flutter/lib/src/widgets/binding.dart
View file @
0d087562
...
...
@@ -435,6 +435,14 @@ mixin WidgetsBinding on BindingBase, ServicesBinding, SchedulerBinding, GestureB
debugProfileBuildsEnabled
=
value
;
},
);
registerBoolServiceExtension
(
name:
'profileUserWidgetBuilds'
,
getter:
()
async
=>
debugProfileBuildsEnabledUserWidgets
,
setter:
(
bool
value
)
async
{
if
(
debugProfileBuildsEnabledUserWidgets
!=
value
)
debugProfileBuildsEnabledUserWidgets
=
value
;
},
);
}
assert
(()
{
...
...
packages/flutter/test/foundation/service_extensions_test.dart
View file @
0d087562
...
...
@@ -171,9 +171,14 @@ void main() {
// 1. exit
// 2. showPerformanceOverlay
const
int
disabledExtensions
=
kIsWeb
?
2
:
0
;
// If you add a service extension... TEST IT! :-)
// ...then increment this number.
expect
(
binding
.
extensions
.
length
,
35
+
widgetInspectorExtensionCount
-
disabledExtensions
);
// The expected number of registered service extensions in the Flutter
// framework, excluding any that are for the widget inspector
// (see widget_inspector_test.dart for tests of the ext.flutter.inspector
// service extensions).
const
int
serviceExtensionCount
=
36
;
expect
(
binding
.
extensions
.
length
,
serviceExtensionCount
+
widgetInspectorExtensionCount
-
disabledExtensions
);
expect
(
console
,
isEmpty
);
debugPrint
=
debugPrintThrottled
;
...
...
@@ -442,6 +447,35 @@ void main() {
expect
(
binding
.
frameScheduled
,
isFalse
);
});
test
(
'Service extensions - profileUserWidgetBuilds'
,
()
async
{
Map
<
String
,
dynamic
>
result
;
expect
(
binding
.
frameScheduled
,
isFalse
);
expect
(
debugProfileBuildsEnabledUserWidgets
,
false
);
result
=
await
binding
.
testExtension
(
'profileUserWidgetBuilds'
,
<
String
,
String
>{});
expect
(
result
,
<
String
,
String
>{
'enabled'
:
'false'
});
expect
(
debugProfileBuildsEnabledUserWidgets
,
false
);
result
=
await
binding
.
testExtension
(
'profileUserWidgetBuilds'
,
<
String
,
String
>{
'enabled'
:
'true'
});
expect
(
result
,
<
String
,
String
>{
'enabled'
:
'true'
});
expect
(
debugProfileBuildsEnabledUserWidgets
,
true
);
result
=
await
binding
.
testExtension
(
'profileUserWidgetBuilds'
,
<
String
,
String
>{});
expect
(
result
,
<
String
,
String
>{
'enabled'
:
'true'
});
expect
(
debugProfileBuildsEnabledUserWidgets
,
true
);
result
=
await
binding
.
testExtension
(
'profileUserWidgetBuilds'
,
<
String
,
String
>{
'enabled'
:
'false'
});
expect
(
result
,
<
String
,
String
>{
'enabled'
:
'false'
});
expect
(
debugProfileBuildsEnabledUserWidgets
,
false
);
result
=
await
binding
.
testExtension
(
'profileUserWidgetBuilds'
,
<
String
,
String
>{});
expect
(
result
,
<
String
,
String
>{
'enabled'
:
'false'
});
expect
(
debugProfileBuildsEnabledUserWidgets
,
false
);
expect
(
binding
.
frameScheduled
,
isFalse
);
});
test
(
'Service extensions - profileRenderObjectPaints'
,
()
async
{
Map
<
String
,
dynamic
>
result
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment