mirror of
https://github.com/flutter/flutter
synced 2024-10-02 22:44:13 +00:00
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:
parent
221235c7ed
commit
b63c4a6db0
|
@ -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);
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue