Add the Flutter video editing application with project management, media import, timeline editing, preview, AI assistance, diagnostics and settings. Include shared UI and native host packages, platform runners, application tests and release tooling. Provide usage and contribution guides, the MIT license and third-party notices. Exclude local credentials, build outputs and validation data.
53 lines
1.6 KiB
Dart
53 lines
1.6 KiB
Dart
import 'dart:convert';
|
|
import 'dart:io';
|
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import '../../integration_test/support/real_media_report.dart';
|
|
|
|
void main() {
|
|
test(
|
|
'incremental report saves preserve metadata and the latest failures',
|
|
() async {
|
|
final directory = await Directory.systemTemp.createTemp(
|
|
'real-media-report-',
|
|
);
|
|
addTearDown(() => directory.delete(recursive: true));
|
|
final file = File('${directory.path}/results.json');
|
|
final metadata = <String, Object?>{
|
|
'platform': 'android',
|
|
'previewOnly': true,
|
|
};
|
|
final report = RealMediaReport(file, metadata: metadata);
|
|
metadata['previewOnly'] = false;
|
|
final checks = <Map<String, Object?>>[];
|
|
report.files.add({
|
|
'path': 'source.mp4',
|
|
'checks': checks,
|
|
'passed': false,
|
|
});
|
|
report.save();
|
|
expect(
|
|
(jsonDecode(await file.readAsString()) as Map)['previewOnly'],
|
|
isTrue,
|
|
);
|
|
checks.add({'stage': 'probe', 'passed': true});
|
|
checks.add({
|
|
'stage': 'preview',
|
|
'passed': false,
|
|
'error': 'frame timeout',
|
|
});
|
|
report.save();
|
|
final saved = jsonDecode(await file.readAsString()) as Map;
|
|
expect(saved['platform'], 'android');
|
|
final recorded = (saved['files'] as List).single as Map;
|
|
expect(recorded['passed'], isFalse);
|
|
expect(
|
|
(recorded['checks'] as List).last,
|
|
containsPair('error', 'frame timeout'),
|
|
);
|
|
expect(File('${file.path}.part').existsSync(), isFalse);
|
|
},
|
|
);
|
|
}
|