Skip to content

Commit b63c4a6

Browse files
Ensure that the engine frame callbacks are installed if the first scheduled frame is a forced frame (#101544)
See #98419
1 parent 221235c commit b63c4a6

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

packages/flutter/lib/src/scheduler/binding.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,7 @@ mixin SchedulerBinding on BindingBase {
825825
debugPrintStack(label: 'scheduleForcedFrame() called. Current phase is $schedulerPhase.');
826826
return true;
827827
}());
828+
ensureFrameCallbacksRegistered();
828829
platformDispatcher.scheduleFrame();
829830
_hasScheduledFrame = true;
830831
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2014 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
import 'package:flutter/scheduler.dart';
6+
import 'package:flutter/widgets.dart';
7+
import 'package:flutter_test/flutter_test.dart';
8+
9+
void main() {
10+
WidgetsFlutterBinding.ensureInitialized();
11+
12+
test('scheduleForcedFrame sets up frame callbacks', () async {
13+
SchedulerBinding.instance.scheduleForcedFrame();
14+
expect(SchedulerBinding.instance.platformDispatcher.onBeginFrame, isNotNull);
15+
});
16+
}

0 commit comments

Comments
 (0)