Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Trim redundant video editor tests

Neeraj Gupta8cb72db46cb9
diff --git a/mobile/apps/photos/test/ui/tools/editor/ente_video_editor_controller_test.dart b/mobile/apps/photos/test/ui/tools/editor/ente_video_editor_controller_test.dart
index 3563e30e8c..c50729d610 100644
--- a/mobile/apps/photos/test/ui/tools/editor/ente_video_editor_controller_test.dart
+++ b/mobile/apps/photos/test/ui/tools/editor/ente_video_editor_controller_test.dart
@@ -30,18 +30,6 @@ void main() {
}
});
- test('four clockwise turns return the original crop', () {
- var crop = sourceCrop;
- for (var index = 0; index < 4; index++) {
- crop = rotateNormalizedRect(crop, 90);
- }
- _expectRectClose(crop, sourceCrop);
- });
-
- test('non-quarter-turn rotation is rejected', () {
- expect(() => rotateNormalizedRect(sourceCrop, 45), throwsArgumentError);
- });
-
test('fixed-ratio crop remains in bounds without changing ratio', () {
final crop = constrainNormalizedCropRect(
rect: const Rect.fromLTRB(-0.1, 0.1, 0.8, 0.9),
diff --git a/mobile/apps/photos/test/ui/tools/editor/video_editor_contract_test.dart b/mobile/apps/photos/test/ui/tools/editor/video_editor_contract_test.dart
index c3e8f7efd2..5edd9bd198 100644
--- a/mobile/apps/photos/test/ui/tools/editor/video_editor_contract_test.dart
+++ b/mobile/apps/photos/test/ui/tools/editor/video_editor_contract_test.dart
@@ -55,13 +55,6 @@ void main() {
'scale=trunc(iw/2)*2:trunc(ih/2)*2',
]);
});
-
- test('rejects non-quarter-turn rotations', () {
- expect(
- () => buildFfmpegVideoFilters(crop: null, rotation: 45),
- throwsArgumentError,
- );
- });
});
test('FFmpeg plan preserves file paths as structured arguments', () {
diff --git a/mobile/packages/native_video_editor/test/native_video_editor_test.dart b/mobile/packages/native_video_editor/test/native_video_editor_test.dart
index 8a0f3ef981..a7d210b817 100644
--- a/mobile/packages/native_video_editor/test/native_video_editor_test.dart
+++ b/mobile/packages/native_video_editor/test/native_video_editor_test.dart
@@ -74,17 +74,6 @@ void main() {
expect(info.frameRate, 29.97);
});
- test('unavailable optional metadata is represented as null', () {
- final info = NativeVideoInfo.fromMap({
- ..._videoInfoMap,
- 'bitrate': 0,
- 'frameRate': -1,
- });
-
- expect(info.bitrate, isNull);
- expect(info.frameRate, isNull);
- });
-
test('non-quarter-turn metadata rotation is rejected', () {
expect(
() => NativeVideoInfo.fromMap({..._videoInfoMap, 'rotation': 45}),
@@ -180,64 +169,6 @@ void main() {
);
});
- test('frame extraction cannot overwrite its input', () async {
- await expectLater(
- NativeVideoEditor.extractFrame(
- VideoFrameRequest(
- inputPath: input.path,
- outputPath: input.path,
- position: Duration.zero,
- maxWidth: 144,
- maxHeight: 120,
- ),
- ),
- throwsArgumentError,
- );
- });
-
- test('timeline destinations must be unique', () async {
- final output = '${directory.path}/same.jpg';
- await expectLater(
- NativeVideoEditor.extractTimeline(
- VideoTimelineRequest(
- requestId: 'trim-duplicate',
- inputPath: input.path,
- outputPaths: [output, output],
- positions: [Duration.zero, const Duration(seconds: 1)],
- maxWidth: 144,
- maxHeight: 120,
- ),
- ),
- throwsArgumentError,
- );
- });
-
- test('frame result must match the requested output path', () async {
- extractionResultOverride = {
- 'videoInfo': _videoInfoMap,
- 'frames': [
- {
- 'outputPath': '${directory.path}/wrong.jpg',
- 'width': 120,
- 'height': 90,
- },
- ],
- };
-
- await expectLater(
- NativeVideoEditor.extractFrame(
- VideoFrameRequest(
- inputPath: input.path,
- outputPath: '${directory.path}/expected.jpg',
- position: Duration.zero,
- maxWidth: 144,
- maxHeight: 120,
- ),
- ),
- throwsFormatException,
- );
- });
-
test('timeline result must contain every requested frame', () async {
extractionResultOverride = {
'videoInfo': _videoInfoMap,
@@ -259,19 +190,6 @@ void main() {
);
});
- test('processing cannot overwrite its input', () async {
- lastCall = null;
-
- await expectLater(
- NativeVideoEditor.processVideo(
- inputPath: input.path,
- outputPath: input.path,
- ),
- throwsArgumentError,
- );
- expect(lastCall, isNull);
- });
-
test('processing requires both trim boundaries', () async {
lastCall = null;