更新超广角相机的变焦比例,确保在相机能力允许的情况下使用0.6x的缩放比例,优化相关UI和测试用例。
This commit is contained in:
@@ -77,7 +77,7 @@ void main() {
|
||||
});
|
||||
|
||||
test(
|
||||
'passes native ultra-wide ratio when camera capabilities allow it',
|
||||
'clamps legacy 0.5x request to 0.6x ultra-wide ratio',
|
||||
() async {
|
||||
final calls = <MethodCall>[];
|
||||
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
|
||||
@@ -86,8 +86,8 @@ void main() {
|
||||
(call) async {
|
||||
calls.add(call);
|
||||
return <String, dynamic>{
|
||||
'zoomRatio': 0.5,
|
||||
'minZoomRatio': 0.5,
|
||||
'zoomRatio': 0.6,
|
||||
'minZoomRatio': 0.6,
|
||||
'maxZoomRatio': 3.0,
|
||||
};
|
||||
},
|
||||
@@ -101,17 +101,17 @@ void main() {
|
||||
.copyWith(
|
||||
session: const RecordingSessionState(
|
||||
zoomRatio: 1.0,
|
||||
minZoomRatio: 0.5,
|
||||
minZoomRatio: 0.6,
|
||||
maxZoomRatio: 3.0,
|
||||
),
|
||||
);
|
||||
|
||||
await notifier.setZoomRatio(0.5);
|
||||
|
||||
expect(calls.single.arguments, <String, dynamic>{'zoomRatio': 0.5});
|
||||
expect(calls.single.arguments, <String, dynamic>{'zoomRatio': 0.6});
|
||||
final session = container.read(recordingViewModelProvider).session;
|
||||
expect(session.zoomRatio, 0.5);
|
||||
expect(session.minZoomRatio, 0.5);
|
||||
expect(session.zoomRatio, 0.6);
|
||||
expect(session.minZoomRatio, 0.6);
|
||||
expect(session.maxZoomRatio, 3.0);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -54,7 +54,7 @@ void main() {
|
||||
expect(find.text('3x'), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('shows 0.6x when 0.5x camera capability supports it', (
|
||||
testWidgets('shows 0.6x when ultra-wide camera capability is below 0.6', (
|
||||
tester,
|
||||
) async {
|
||||
await pumpHud(tester, minZoomRatio: 0.5);
|
||||
@@ -75,7 +75,7 @@ void main() {
|
||||
expect(find.text('1x'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('marks current 0.5x zoom ratio as selected on 0.6x UI', (
|
||||
testWidgets('marks current ultra-wide zoom ratio as selected on 0.6x UI', (
|
||||
tester,
|
||||
) async {
|
||||
await pumpHud(tester, zoomRatio: 0.5, minZoomRatio: 0.5);
|
||||
@@ -102,7 +102,7 @@ void main() {
|
||||
expect(find.text('1x'), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('tapping 0.6x reports 0.5 when camera supports 0.5x', (
|
||||
testWidgets('tapping 0.6x reports 0.6 when camera capability is below 0.6', (
|
||||
tester,
|
||||
) async {
|
||||
double? selected;
|
||||
@@ -115,7 +115,7 @@ void main() {
|
||||
await tester.tap(find.text('0.6x'));
|
||||
await tester.pump();
|
||||
|
||||
expect(selected, 0.5);
|
||||
expect(selected, 0.6);
|
||||
});
|
||||
|
||||
testWidgets('tapping 0.6x reports 0.6 when camera only supports 0.6x', (
|
||||
@@ -148,7 +148,7 @@ void main() {
|
||||
expect(mainButton.enabled, isFalse);
|
||||
});
|
||||
|
||||
testWidgets('disables main zoom presets while recording on 0.5x', (
|
||||
testWidgets('disables main zoom presets while recording on ultra-wide', (
|
||||
tester,
|
||||
) async {
|
||||
await pumpHud(tester, zoomRatio: 0.5, minZoomRatio: 0.5, isRecording: true);
|
||||
|
||||
Reference in New Issue
Block a user