Made flag for debugging build time of user created widgets (#100926)
* Added a bool that allows us to limit debugProfileBuildsEnabled to user created widgets. * made it turned on by default * switched to hashmap * Cleaned everything up and added tests * fixed an odd test where it wants to be able to add asserts and run in profile mode * hixie feedback * hixie2 * made it default to false * updated docstring as per dans request
This commit is contained in:
@@ -110,6 +110,17 @@ void main() {
|
||||
expect(args['color'], 'Color(0xffffffff)');
|
||||
debugProfileBuildsEnabled = false;
|
||||
|
||||
debugProfileBuildsEnabledUserWidgets = true;
|
||||
await runFrame(() { TestRoot.state.updateWidget(Placeholder(key: UniqueKey(), color: const Color(0xFFFFFFFF))); });
|
||||
events = await fetchInterestingEvents(interestingLabels);
|
||||
expect(
|
||||
events.map<String>(eventToName),
|
||||
<String>['BUILD', 'Placeholder', 'LAYOUT', 'UPDATING COMPOSITING BITS', 'PAINT', 'COMPOSITING', 'FINALIZE TREE'],
|
||||
);
|
||||
args = (events.where((TimelineEvent event) => event.json!['name'] == '$Placeholder').single.json!['args'] as Map<String, Object?>).cast<String, String>();
|
||||
expect(args['color'], 'Color(0xffffffff)');
|
||||
debugProfileBuildsEnabledUserWidgets = false;
|
||||
|
||||
debugProfileLayoutsEnabled = true;
|
||||
await runFrame(() { TestRoot.state.updateWidget(Placeholder(key: UniqueKey())); });
|
||||
events = await fetchInterestingEvents(interestingLabels);
|
||||
|
||||
Reference in New Issue
Block a user