fix(flutter): 回前台复位残留画中画状态
This commit is contained in:
1 parent
28ff9a7642
commit
bc8f3bcab7
2 files changed
+36
No files matched your search
@@ -187,6 +187,34 @@ void main() {
|
||||
|
||||
expect(logic.pip, isFalse);
|
||||
});
|
||||
|
||||
test('should_clear_stale_pip_when_app_returns_to_foreground', () async {
|
||||
final factory = _RecordingFactory();
|
||||
final drama = _drama('signal');
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
final immersive = <bool>[];
|
||||
logic.attach(
|
||||
PlayerPage(drama: drama, initialIndex: 0),
|
||||
isMounted: () => true,
|
||||
);
|
||||
logic.onImmersiveChanged = immersive.add;
|
||||
logic.start(factory: factory.create, coordinator: PlaybackCoordinator());
|
||||
await _drain(logic);
|
||||
|
||||
// 模拟画中画已进入但退出时没有回调 false。
|
||||
logic.onPipChanged(true);
|
||||
expect(logic.chromeHidden, isTrue);
|
||||
|
||||
logic.onLifecycle(AppLifecycleState.resumed);
|
||||
|
||||
expect(logic.pip, isFalse);
|
||||
expect(logic.pipPreparing, isFalse);
|
||||
expect(logic.chromeHidden, isFalse);
|
||||
expect(immersive.last, isFalse);
|
||||
|
||||
logic.dispose();
|
||||
await _drain(logic);
|
||||
});
|
||||
});
|
||||
|
||||
group('history writes', () {
|
||||
|
||||
Reference in new issue
Block a user