Ensure that the engine frame callbacks are installed if the first scheduled frame is a forced frame (#101544)
See https://github.com/flutter/flutter/issues/98419
This commit is contained in:
@@ -825,6 +825,7 @@ mixin SchedulerBinding on BindingBase {
|
||||
debugPrintStack(label: 'scheduleForcedFrame() called. Current phase is $schedulerPhase.');
|
||||
return true;
|
||||
}());
|
||||
ensureFrameCallbacksRegistered();
|
||||
platformDispatcher.scheduleFrame();
|
||||
_hasScheduledFrame = true;
|
||||
}
|
||||
|
||||
16
packages/flutter/test/scheduler/binding_test.dart
Normal file
16
packages/flutter/test/scheduler/binding_test.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
test('scheduleForcedFrame sets up frame callbacks', () async {
|
||||
SchedulerBinding.instance.scheduleForcedFrame();
|
||||
expect(SchedulerBinding.instance.platformDispatcher.onBeginFrame, isNotNull);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user