feat(app): 播放器增加清晰度档位入口
This commit is contained in:
1 parent
30a5fa0776
commit
2b2b7e9913
9 files changed
+242
-1
No files matched your search
@@ -38,8 +38,15 @@ void main() {
|
||||
expect(find.byType(PageView), findsOneWidget);
|
||||
await tester.tap(find.byKey(const Key('player-more')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const Key('player-more-quality')), findsOneWidget);
|
||||
expect(find.byKey(const Key('player-more-download')), findsOneWidget);
|
||||
expect(find.byKey(const Key('player-more-pip')), findsOneWidget);
|
||||
await tester.tap(find.byKey(const Key('player-more-quality')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const Key('player-quality-sheet')), findsOneWidget);
|
||||
expect(find.text('720P'), findsOneWidget);
|
||||
await tester.binding.handlePopRoute();
|
||||
await tester.pumpAndSettle();
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
// Author: fruit.com.cn
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:fruitshorts/l10n/app_localizations.dart';
|
||||
import 'package:fruitshorts/pages/player/widgets/quality_sheet.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('should_list_every_returned_quality_when_sheet_opens', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
locale: const Locale('en'),
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
home: const Scaffold(
|
||||
body: QualitySheet(qualities: ['AUTO', '720P', '1080P']),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(find.text('Auto'), findsOneWidget);
|
||||
expect(find.text('720P'), findsOneWidget);
|
||||
expect(find.text('1080P'), findsOneWidget);
|
||||
expect(find.byIcon(Icons.check_rounded), findsOneWidget);
|
||||
expect(
|
||||
find.text('HLS adjusts the bitrate automatically for your connection.'),
|
||||
findsOneWidget,
|
||||
);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user