feat(workspace): 桌面工作区、主题与交互更新,发布 0.1.2
Gitea CI / Check code and tests (push) Successful in 6m37s
Gitea CI / Build Windows x64 app (push) Successful in 3m18s
Gitea CI / Build Android APK (push) Successful in 3m47s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m7s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 50s
Gitea CI / Gitea CI passed (push) Successful in 2s
Gitea Release / Prepare draft Release (push) Successful in 9s
Gitea Release / Upload Android to draft Release (push) Successful in 16s
Gitea Release / Upload Windows to draft Release (push) Successful in 22s
Gitea Release / Verify and publish Release (push) Successful in 14s
Gitea CI / Check code and tests (push) Successful in 6m37s
Gitea CI / Build Windows x64 app (push) Successful in 3m18s
Gitea CI / Build Android APK (push) Successful in 3m47s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m7s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 50s
Gitea CI / Gitea CI passed (push) Successful in 2s
Gitea Release / Prepare draft Release (push) Successful in 9s
Gitea Release / Upload Android to draft Release (push) Successful in 16s
Gitea Release / Upload Windows to draft Release (push) Successful in 22s
Gitea Release / Verify and publish Release (push) Successful in 14s
This commit was merged in pull request #13.
This commit is contained in:
1 parent
aa5255d1e4
commit
abc1868550
260 files changed
+43964
-5591
No files matched your search
@@ -87,4 +87,95 @@ void main() {
|
||||
}
|
||||
},
|
||||
);
|
||||
test(
|
||||
'LRU trims idle output but preserves leased controllers until release',
|
||||
() async {
|
||||
var sessionId = 0;
|
||||
final closed = <String>[];
|
||||
for (final id in ['1', '2', '3']) {
|
||||
final events = MethodChannel('cutdex_runtime/sessions/$id');
|
||||
messenger.setMockMethodCallHandler(events, (call) async {
|
||||
if (call.method == 'listen') {
|
||||
scheduleMicrotask(
|
||||
() => messenger.handlePlatformMessage(
|
||||
events.name,
|
||||
const StandardMethodCodec().encodeSuccessEnvelope({
|
||||
'type': 'attached',
|
||||
}),
|
||||
(_) {},
|
||||
),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
}
|
||||
messenger.setMockMethodCallHandler(channel, (call) async {
|
||||
switch (call.method) {
|
||||
case 'capabilities':
|
||||
return {
|
||||
'contractVersion': 1,
|
||||
'features': {'playback.preview': 'available'},
|
||||
};
|
||||
case 'createSession':
|
||||
return {'sessionId': '${++sessionId}'};
|
||||
case 'probe':
|
||||
return {
|
||||
'duration': MediaTime(2, 1).toMap(),
|
||||
'videoTrackCount': 1,
|
||||
'videoTrackIds': [1],
|
||||
'audioTrackCount': 0,
|
||||
'audioTrackIds': <int>[],
|
||||
'isProtected': false,
|
||||
};
|
||||
case 'load':
|
||||
return (call.arguments as Map)['plan']['revision'];
|
||||
case 'close':
|
||||
closed.add((call.arguments as Map)['sessionId'] as String);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
final first = await createPreviewFixture(Uri.file('/fixture-1.mov'));
|
||||
final second = await createPreviewFixture(Uri.file('/fixture-2.mov'));
|
||||
final third = await createPreviewFixture(Uri.file('/fixture-3.mov'));
|
||||
final registry = PreviewControllerRegistry(
|
||||
CutdexRuntime(channel: channel),
|
||||
maximumCachedControllers: 2,
|
||||
);
|
||||
try {
|
||||
final releaseFirst = registry.retain(('p', 'first'));
|
||||
final releaseSecond = registry.retain(('p', 'second'));
|
||||
final releaseThird = registry.retain(('p', 'third'));
|
||||
final one = await registry.prepare(('p', 'first'), first.timeline);
|
||||
final two = await registry.prepare(('p', 'second'), second.timeline);
|
||||
final three = await registry.prepare(('p', 'third'), third.timeline);
|
||||
expect(one!.ready, isTrue);
|
||||
expect(two!.ready, isTrue);
|
||||
expect(three!.ready, isTrue);
|
||||
expect(registry.cached(('p', 'first')), same(one));
|
||||
releaseFirst();
|
||||
expect(registry.cached(('p', 'first')), isNull);
|
||||
expect(registry.cached(('p', 'second')), same(two));
|
||||
expect(registry.cached(('p', 'third')), same(three));
|
||||
releaseFirst(); // Releases are idempotent.
|
||||
releaseSecond();
|
||||
releaseThird();
|
||||
await registry.invalidate(('p', 'second'));
|
||||
await registry.invalidate(('p', 'third'));
|
||||
expect(closed.toSet(), {'1', '2', '3'});
|
||||
} finally {
|
||||
registry.dispose();
|
||||
for (final id in ['1', '2', '3']) {
|
||||
messenger.setMockMethodCallHandler(
|
||||
MethodChannel('cutdex_runtime/sessions/$id'),
|
||||
null,
|
||||
);
|
||||
}
|
||||
messenger.setMockMethodCallHandler(channel, null);
|
||||
for (final fixture in [first, second, third]) {
|
||||
await fixture.workspace.close();
|
||||
await fixture.directory.delete(recursive: true);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user