Revert "merge: 合并 K95.2 首切频道封面过渡"
This reverts commita2a491d056, reversing changes made to838ca2ce2a.
This commit is contained in:
1 parent
a2a491d056
commit
f8769f2e1d
5 files changed
+19
-111
No files matched your search
@@ -131,12 +131,18 @@ void main() {
|
||||
expect(player.playing, isTrue);
|
||||
});
|
||||
|
||||
testWidgets('should_show_poster_before_video_first_frame', (tester) async {
|
||||
testWidgets('should_keep_video_surface_background_black', (tester) async {
|
||||
await _pumpApp(tester);
|
||||
await _openSeriesPlayer(tester);
|
||||
|
||||
expect(find.byKey(const Key('player-video-poster')), findsOneWidget);
|
||||
expect(find.byKey(const Key('player-fallback-background')), findsNothing);
|
||||
expect(
|
||||
tester
|
||||
.widget<ColoredBox>(
|
||||
find.byKey(const Key('player-fallback-background')),
|
||||
)
|
||||
.color,
|
||||
Colors.black,
|
||||
);
|
||||
expect(find.byKey(const Key('player-fallback-cover')), findsNothing);
|
||||
expect(find.byKey(const Key('player-fallback-scrim')), findsNothing);
|
||||
});
|
||||
@@ -465,8 +471,9 @@ void main() {
|
||||
find.byKey(const Key('player-interaction-rail')),
|
||||
);
|
||||
expect(find.byKey(const Key('player-background')), findsNothing);
|
||||
expect(find.byKey(const Key('player-video-poster')), findsOneWidget);
|
||||
expect(find.byKey(const Key('player-fallback-background')), findsNothing);
|
||||
final fallback = find.byKey(const Key('player-fallback-background'));
|
||||
expect(fallback, findsOneWidget);
|
||||
expect(tester.widget<ColoredBox>(fallback).color, Colors.black);
|
||||
expect(find.byKey(const Key('player-fallback-cover')), findsNothing);
|
||||
expect(find.byKey(const Key('player-fallback-scrim')), findsNothing);
|
||||
expect(
|
||||
|
||||
@@ -7,24 +7,6 @@ import 'package:video_player/video_player.dart';
|
||||
import 'package:fruitshorts/pages/player/widgets/player_video_surface.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('should_show_poster_when_controller_is_missing', (tester) async {
|
||||
await _pumpBareSurface(tester, posterUrl: '/files/poster.png');
|
||||
|
||||
expect(find.byKey(const Key('player-video-poster')), findsOneWidget);
|
||||
expect(find.byKey(const Key('player-fallback-background')), findsNothing);
|
||||
expect(_opacity(tester), 0);
|
||||
});
|
||||
|
||||
testWidgets('should_keep_black_fallback_when_poster_is_empty', (
|
||||
tester,
|
||||
) async {
|
||||
await _pumpBareSurface(tester);
|
||||
|
||||
expect(find.byKey(const Key('player-video-poster')), findsNothing);
|
||||
expect(_fallbackColor(tester), Colors.black);
|
||||
expect(_opacity(tester), 0);
|
||||
});
|
||||
|
||||
testWidgets('should_keep_fallback_visible_before_video_is_ready', (
|
||||
tester,
|
||||
) async {
|
||||
@@ -114,25 +96,6 @@ Future<VideoPlayerController> _pumpSurface(
|
||||
return controller;
|
||||
}
|
||||
|
||||
Future<void> _pumpBareSurface(
|
||||
WidgetTester tester, {
|
||||
String posterUrl = '',
|
||||
}) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Scaffold(
|
||||
body: PlayerVideoSurface(
|
||||
controller: null,
|
||||
videoUrl: '',
|
||||
posterUrl: posterUrl,
|
||||
theater: false,
|
||||
onTap: () {},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Color _fallbackColor(WidgetTester tester) {
|
||||
return tester
|
||||
.widget<ColoredBox>(find.byKey(const Key('player-fallback-background')))
|
||||
|
||||
Reference in new issue
Block a user