fix(player): 播放页改为非阻塞加载

This commit is contained in:
Zhou Weidong committed 2026-10-26 17:43:57 +08:00
1 parent e8f192ccf8
commit ee4e573f4f
7 files changed
+239 -455

No files matched your search

@@ -470,7 +470,6 @@ 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(
@@ -485,7 +484,6 @@ 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(
@@ -552,24 +550,6 @@ 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
.byWidgetPredicate(
(widget) => widget is PlayerPage && !widget.homeMode,
)
.evaluate()
.isNotEmpty) {
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;