refactor(core): own editor UI and pin verified native releases
Gitea CI / Check code and tests (pull_request) Failing after 8s
Gitea CI / Build Android APK (pull_request) Skipped
Gitea CI / Build Windows x64 app (pull_request) Skipped
Gitea CI / Audit and package Windows x64 (pull_request) Skipped
Gitea CI / Assemble and validate CI artifacts (pull_request) Skipped
Gitea CI / Gitea CI passed (pull_request) Failing after 1s
Gitea CI / Check code and tests (pull_request) Failing after 8s
Gitea CI / Build Android APK (pull_request) Skipped
Gitea CI / Build Windows x64 app (pull_request) Skipped
Gitea CI / Audit and package Windows x64 (pull_request) Skipped
Gitea CI / Assemble and validate CI artifacts (pull_request) Skipped
Gitea CI / Gitea CI passed (pull_request) Failing after 1s
This commit is contained in:
1 parent
796a3852a2
commit
38ca180cf7
354 files changed
+29841
-642
No files matched your search
@@ -0,0 +1,82 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:cutdex_timeline_ui/cutdex_timeline_ui.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
test(
|
||||
'adding a header preserves all body regions at their viewport positions',
|
||||
() {
|
||||
for (final audioOnly in [false, true]) {
|
||||
final before = TimelineClipLayout(
|
||||
bounds: const Rect.fromLTWH(25, 64, 240, 76),
|
||||
nameHeight: 16,
|
||||
audioOnly: audioOnly,
|
||||
hasVideoAudio: !audioOnly,
|
||||
);
|
||||
final after = TimelineClipLayout(
|
||||
bounds: const Rect.fromLTWH(25, 48, 240, 92),
|
||||
headerHeight: 16,
|
||||
nameHeight: 16,
|
||||
audioOnly: audioOnly,
|
||||
hasVideoAudio: !audioOnly,
|
||||
);
|
||||
for (final pair in [
|
||||
(before.body, after.body),
|
||||
(before.name, after.name),
|
||||
(before.preview, after.preview),
|
||||
(before.waveformBackground, after.waveformBackground),
|
||||
(before.waveform, after.waveform),
|
||||
]) {
|
||||
expect(before.toViewport(pair.$1), after.toViewport(pair.$2));
|
||||
}
|
||||
expect(
|
||||
before.bounds.topLeft + before.keyframeCenter,
|
||||
after.bounds.topLeft + after.keyframeCenter,
|
||||
);
|
||||
expect(after.header.bottom, after.body.top);
|
||||
expect(after.name.bottom, after.preview.top);
|
||||
if (!audioOnly) {
|
||||
expect(after.preview.bottom, after.waveformBackground.top);
|
||||
expect(after.preview.height, 44);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
test(
|
||||
'small clip regions stay inside the clip and omit an undersized waveform',
|
||||
() {
|
||||
for (final width in [0.0, 1.0, 3.0, 20.0]) {
|
||||
for (final height in [0.0, 16.0, 20.0, 35.0]) {
|
||||
for (final audioOnly in [false, true]) {
|
||||
final layout = TimelineClipLayout(
|
||||
bounds: Rect.fromLTWH(-80, 150, width, height),
|
||||
headerHeight: 16,
|
||||
nameHeight: 16,
|
||||
audioOnly: audioOnly,
|
||||
hasVideoAudio: !audioOnly,
|
||||
);
|
||||
for (final region in [
|
||||
layout.header,
|
||||
layout.body,
|
||||
layout.bodyPaintBounds,
|
||||
layout.name,
|
||||
layout.preview,
|
||||
layout.waveformBackground,
|
||||
layout.waveform,
|
||||
]) {
|
||||
expect(region.width, greaterThanOrEqualTo(0));
|
||||
expect(region.height, greaterThanOrEqualTo(0));
|
||||
expect(region.left, greaterThanOrEqualTo(0));
|
||||
expect(region.top, greaterThanOrEqualTo(0));
|
||||
expect(region.right, lessThanOrEqualTo(width));
|
||||
expect(region.bottom, lessThanOrEqualTo(height));
|
||||
}
|
||||
expect(layout.waveform.isEmpty, isTrue);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user