fix(player): 收紧图片与快速切集资源占用
This commit is contained in:
1 parent
2fef7470e0
commit
80c962a95c
10 files changed
+281
-30
No files matched your search
@@ -64,6 +64,38 @@ void main() {
|
||||
expect(loader.vttCalls, 0);
|
||||
});
|
||||
|
||||
testWidgets('should_decode_fullscreen_poster_at_screen_width', (
|
||||
tester,
|
||||
) async {
|
||||
final service = SpriteThumbnailAxisService(loader: _FakeSpriteLoader());
|
||||
addTearDown(service.dispose);
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: MediaQuery(
|
||||
data: const MediaQueryData(devicePixelRatio: 3),
|
||||
child: Center(
|
||||
child: SizedBox(
|
||||
width: 390,
|
||||
height: 844,
|
||||
child: PlayerOpeningFrame(
|
||||
posterUrl: 'https://cdn.test/poster.jpg',
|
||||
thumbnailsUrl: '',
|
||||
spriteSource: service,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final image = tester.widget<Image>(
|
||||
find.byKey(const Key('player-opening-poster')),
|
||||
);
|
||||
final provider = image.image as ResizeImage;
|
||||
expect(provider.width, 1170);
|
||||
});
|
||||
|
||||
testWidgets('should_return_no_opening_frame_when_thumbnails_is_empty', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
Reference in new issue
Block a user