-
Notifications
You must be signed in to change notification settings - Fork 400
Show debug-mode message for widget rebuilds in profile mode #9755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
crackedhandle
wants to merge
13
commits into
flutter:master
Choose a base branch
from
crackedhandle:fix-widget-rebuilds-profile-mode
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e7dfd10
Show debug-mode message for widget rebuilds in profile mode
crackedhandle e1c52f3
Move RebuildStatsView tests to performance_screen_test
crackedhandle 23d9d05
Fix formatting and add release note
crackedhandle a9febdd
Resolve merge conflict in release notes
crackedhandle 0879481
style: format performance_screen_test
crackedhandle 808bf1a
fix: restore removed tests and apply only required changes
crackedhandle d6ff5d2
style: format file and add required comments
crackedhandle 2b176c3
fix: properly remove build artifacts
crackedhandle 05507a2
Remove unnecessary imports
crackedhandle 560df3a
Merge branch 'master' into fix-widget-rebuilds-profile-mode
crackedhandle de6949d
Address review feedback: use CenteredMessage, revert unrelated change…
crackedhandle a74899a
Merge branch 'fix-widget-rebuilds-profile-mode' of https://github.com…
crackedhandle 575b372
Merge remote-tracking branch 'upstream/master' into fix-widget-rebuil…
crackedhandle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ import 'dart:async'; | |
|
|
||
| import 'package:devtools_app/devtools_app.dart'; | ||
| import 'package:devtools_app/src/screens/performance/panes/controls/performance_controls.dart'; | ||
| import 'package:devtools_app/src/screens/performance/panes/rebuild_stats/rebuild_stats.dart'; | ||
| import 'package:devtools_app/src/screens/performance/panes/timeline_events/timeline_events_view.dart'; | ||
| import 'package:devtools_app/src/screens/performance/tabbed_performance_view.dart'; | ||
| import 'package:devtools_app/src/shared/feature_flags.dart'; | ||
|
|
@@ -218,7 +219,6 @@ void main() { | |
| await tester.runAsync(() async { | ||
| await pumpPerformanceScreen(tester, runAsync: true); | ||
| await tester.pumpAndSettle(); | ||
|
|
||
| final chartButtonFinder = find.byType(VisibilityButton); | ||
| expect(chartButtonFinder, findsOneWidget); | ||
|
|
||
|
|
@@ -231,7 +231,6 @@ void main() { | |
|
|
||
| await tester.tap(chartButtonFinder); | ||
| await tester.pumpAndSettle(); | ||
|
|
||
| // The flutter frames chart should no longer be visible. | ||
| expect(find.byType(FramesChartControls), findsNothing); | ||
| expect( | ||
|
|
@@ -252,46 +251,6 @@ void main() { | |
| }, | ||
| ); | ||
|
|
||
| // testWidgetsWithWindowSize( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please revert this change since it is unrelated to this PR. I'm not sure why this test was commented out, but we can address this separately. |
||
| // 'clears timeline on clear', | ||
| // windowSize, | ||
| // (WidgetTester tester) async { | ||
| // await tester.runAsync(() async { | ||
| // await pumpPerformanceScreen(tester, runAsync: true); | ||
| // await tester.pumpAndSettle(); | ||
|
|
||
| // // Ensure the Timeline Events tab is selected. | ||
| // final timelineEventsTabFinder = find.text('Timeline Events'); | ||
| // expect(timelineEventsTabFinder, findsOneWidget); | ||
| // await tester.tap(timelineEventsTabFinder); | ||
| // await tester.pumpAndSettle(); | ||
|
|
||
| // expect( | ||
| // controller.timelineEventsController.allTraceEvents, | ||
| // isNotEmpty, | ||
| // ); | ||
| // expect(find.byType(FlutterFramesChart), findsOneWidget); | ||
| // expect(find.byType(TimelineFlameChart), findsOneWidget); | ||
| // expect( | ||
| // find.byKey(TimelineEventsView.emptyTimelineKey), | ||
| // findsNothing, | ||
| // ); | ||
| // expect(find.byType(EventDetails), findsOneWidget); | ||
|
|
||
| // await tester.tap(find.byIcon(Icons.block)); | ||
| // await tester.pumpAndSettle(); | ||
| // expect(controller.timelineEventsController.allTraceEvents, isEmpty); | ||
| // expect(find.byType(FlutterFramesChart), findsOneWidget); | ||
| // expect(find.byType(TimelineFlameChart), findsNothing); | ||
| // expect( | ||
| // find.byKey(TimelineEventsView.emptyTimelineKey), | ||
| // findsOneWidget, | ||
| // ); | ||
| // expect(find.byType(EventDetails), findsNothing); | ||
| // }); | ||
| // }, | ||
| // ); | ||
|
|
||
| testWidgetsWithWindowSize('opens enhance tracing overlay', windowSize, ( | ||
| WidgetTester tester, | ||
| ) async { | ||
|
|
@@ -395,6 +354,64 @@ void main() { | |
| }, | ||
| ); | ||
| }); | ||
|
|
||
| group('RebuildStatsView', () { | ||
| late FakeServiceConnectionManager fakeServiceConnection; | ||
| late RebuildCountModel model; | ||
| late ValueNotifier<FlutterFrame?> selectedFrame; | ||
|
|
||
| setUp(() { | ||
| fakeServiceConnection = FakeServiceConnectionManager(); | ||
| mockConnectedApp(fakeServiceConnection.serviceManager.connectedApp!); | ||
| setGlobal(ServiceConnectionManager, fakeServiceConnection); | ||
| setGlobal(IdeTheme, IdeTheme()); | ||
| setGlobal(NotificationService, NotificationService()); | ||
| setGlobal(BannerMessagesController, BannerMessagesController()); | ||
| setGlobal(PreferencesController, PreferencesController()); | ||
| setGlobal(OfflineDataController, OfflineDataController()); | ||
| model = RebuildCountModel(); | ||
| selectedFrame = ValueNotifier<FlutterFrame?>(null); | ||
| }); | ||
|
|
||
| testWidgets('shows message when running in profile mode', ( | ||
| WidgetTester tester, | ||
| ) async { | ||
| mockConnectedApp( | ||
| fakeServiceConnection.serviceManager.connectedApp!, | ||
| isProfileBuild: true, | ||
| ); | ||
|
|
||
| await tester.pumpWidget( | ||
| wrapWithControllers( | ||
| RebuildStatsView(model: model, selectedFrame: selectedFrame), | ||
| ), | ||
| ); | ||
| await tester.pump(); | ||
|
|
||
| expect( | ||
| find.textContaining('Widget rebuild counts are only available'), | ||
| findsOneWidget, | ||
| ); | ||
| }); | ||
|
|
||
| testWidgets('shows normal UI when running in debug mode', ( | ||
| WidgetTester tester, | ||
| ) async { | ||
| mockConnectedApp(fakeServiceConnection.serviceManager.connectedApp!); | ||
|
|
||
| await tester.pumpWidget( | ||
| wrapWithControllers( | ||
| RebuildStatsView(model: model, selectedFrame: selectedFrame), | ||
| ), | ||
| ); | ||
| await tester.pump(); | ||
|
|
||
| expect( | ||
| find.textContaining('Widget rebuild counts are only available'), | ||
| findsNothing, | ||
| ); | ||
| }); | ||
| }); | ||
| }); | ||
| } | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert all local changes to this file other than the entry you want to add. thanks!