fix(player): 规范预热回收日志并抓帧过渡

This commit is contained in:
Zhou Weidong committed 2026-10-26 17:13:56 +08:00
1 parent bb2c729a7e
commit 4d3d067f77
6 files changed
+186 -40

No files matched your search

@@ -470,6 +470,7 @@ void main() {
await _pumpRecommend(tester);
await tester.tap(find.byKey(const Key('home-feed-series-name')));
await _waitForFullPlayer(tester);
await tester.pumpAndSettle();
expect(find.byType(PlayerPage).last, findsOneWidget);
expect(
@@ -484,6 +485,7 @@ void main() {
expect(find.byKey(const Key('recommend-tab-recommend')), findsOneWidget);
await tester.tap(find.byKey(const Key('home-feed-full-series')));
await _waitForFullPlayer(tester);
await tester.pumpAndSettle();
expect(find.byType(PlayerPage).last, findsOneWidget);
expect(
@@ -550,6 +552,17 @@ void main() {
});
}
Future<void> _waitForFullPlayer(WidgetTester tester) async {
for (var attempt = 0; attempt < 120; attempt++) {
await tester.runAsync(
() => Future<void>.delayed(const Duration(milliseconds: 10)),
);
await tester.pump(const Duration(milliseconds: 16));
if (find.byType(PlayerPage).evaluate().length > 1) return;
}
fail('full player route was not pushed after frame capture');
}
Future<void> _pumpRecommend(WidgetTester tester) async {
tester.view.physicalSize = const Size(390, 844);
tester.view.devicePixelRatio = 1;