Unverified Commit 50828a13 authored by Ming Lyu (CareF)'s avatar Ming Lyu (CareF) Committed by GitHub

bug fix (#62349)

parent f4e10b4f
...@@ -41,8 +41,7 @@ void macroPerfTestE2E( ...@@ -41,8 +41,7 @@ void macroPerfTestE2E(
binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.benchmarkLive; binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.benchmarkLive;
testWidgets(testName, (WidgetTester tester) async { testWidgets(testName, (WidgetTester tester) async {
assert((tester.binding as LiveTestWidgetsFlutterBinding).framePolicy == assert(tester.binding == binding);
LiveTestWidgetsFlutterBindingFramePolicy.fullyLive);
app.main(); app.main();
await tester.pumpAndSettle(); await tester.pumpAndSettle();
...@@ -61,6 +60,8 @@ void macroPerfTestE2E( ...@@ -61,6 +60,8 @@ void macroPerfTestE2E(
expect(button, findsOneWidget); expect(button, findsOneWidget);
await tester.pumpAndSettle(); await tester.pumpAndSettle();
await tester.tap(button); await tester.tap(button);
// Cannot be pumpAndSettle because some tests have inifite animation.
await tester.pump(const Duration(milliseconds: 20));
if (pageDelay != null) { if (pageDelay != null) {
// Wait for the page to load // Wait for the page to load
...@@ -108,7 +109,7 @@ class FrameTimingSummarizer { ...@@ -108,7 +109,7 @@ class FrameTimingSummarizer {
final List<Duration> frameRasterizerTime = List<Duration>.unmodifiable( final List<Duration> frameRasterizerTime = List<Duration>.unmodifiable(
data.map<Duration>((FrameTiming datum) => datum.rasterDuration), data.map<Duration>((FrameTiming datum) => datum.rasterDuration),
); );
final List<Duration> frameRasterizerTimeSorted = List<Duration>.from(frameBuildTime)..sort(); final List<Duration> frameRasterizerTimeSorted = List<Duration>.from(frameRasterizerTime)..sort();
final Duration Function(Duration, Duration) add = (Duration a, Duration b) => a + b; final Duration Function(Duration, Duration) add = (Duration a, Duration b) => a + b;
return FrameTimingSummarizer._( return FrameTimingSummarizer._(
frameBuildTime: frameBuildTime, frameBuildTime: frameBuildTime,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment