Unverified Commit 1cb912e7 authored by ColdPaleLight's avatar ColdPaleLight Committed by GitHub

Make the application lifecycle does not affect `SchedulerBinding.scheduleForcedFrame`. (#97468)

parent ce5fdff8
...@@ -818,11 +818,6 @@ mixin SchedulerBinding on BindingBase { ...@@ -818,11 +818,6 @@ mixin SchedulerBinding on BindingBase {
/// Consider using [scheduleWarmUpFrame] instead if the goal is to update the /// Consider using [scheduleWarmUpFrame] instead if the goal is to update the
/// rendering as soon as possible (e.g. at application startup). /// rendering as soon as possible (e.g. at application startup).
void scheduleForcedFrame() { void scheduleForcedFrame() {
// TODO(chunhtai): Removes the if case once the issue is fixed
// https://github.com/flutter/flutter/issues/45131
if (!framesEnabled)
return;
if (_hasScheduledFrame) if (_hasScheduledFrame)
return; return;
assert(() { assert(() {
......
...@@ -177,10 +177,9 @@ void main() { ...@@ -177,10 +177,9 @@ void main() {
tester.binding.scheduleFrame(); tester.binding.scheduleFrame();
expect(tester.binding.hasScheduledFrame, isFalse); expect(tester.binding.hasScheduledFrame, isFalse);
// TODO(chunhtai): fix this test after workaround is removed
// https://github.com/flutter/flutter/issues/45131
tester.binding.scheduleForcedFrame(); tester.binding.scheduleForcedFrame();
expect(tester.binding.hasScheduledFrame, isFalse); expect(tester.binding.hasScheduledFrame, isTrue);
await tester.pump();
int frameCount = 0; int frameCount = 0;
tester.binding.addPostFrameCallback((Duration duration) { tester.binding.addPostFrameCallback((Duration duration) {
......
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