Диагностика допуска правой камеры в интерфейс
This commit is contained in:
@@ -15,6 +15,7 @@ let WorkspaceLayoutApiError;
|
||||
let WorkspaceLayoutContractError;
|
||||
let admitLiveDefaultPresentations;
|
||||
let automaticLivePresentationIdentity;
|
||||
let pendingLiveCameraPresentationDiagnostics;
|
||||
let livePresentationCloseFence;
|
||||
let restoredLayoutMayAdmitLiveDefault;
|
||||
let observationPresentationSourceAfterLayoutApply;
|
||||
@@ -39,6 +40,7 @@ before(async () => {
|
||||
({
|
||||
admitLiveDefaultPresentations,
|
||||
automaticLivePresentationIdentity,
|
||||
pendingLiveCameraPresentationDiagnostics,
|
||||
livePresentationCloseFence,
|
||||
restoredLayoutMayAdmitLiveDefault,
|
||||
observationPresentationSourceAfterLayoutApply,
|
||||
@@ -375,6 +377,68 @@ test("a restored layout admits same-lineage replacements and the next acquisitio
|
||||
assert.deepEqual(deliberatelyClosed.admittedIdentities, []);
|
||||
});
|
||||
|
||||
test("live camera diagnostics distinguish catalog projection from window admission", () => {
|
||||
const camera = {
|
||||
id: "k1:sensor.camera.right",
|
||||
sourceId: "sensor.camera.right",
|
||||
modality: "video",
|
||||
availability: "streaming",
|
||||
transport: "websocket",
|
||||
previewUrl: null,
|
||||
delivery: {
|
||||
id: "camera-preview-2",
|
||||
kind: "mse-fmp4-websocket",
|
||||
url: "/camera-preview/2",
|
||||
mediaType: 'video/mp4; codecs="avc1.641028"',
|
||||
},
|
||||
activation: {
|
||||
groupId: "k1:device-session:camera.preview.decoder",
|
||||
maxActive: 1,
|
||||
selected: true,
|
||||
controllable: false,
|
||||
},
|
||||
binding: {
|
||||
deviceId: "k1-a",
|
||||
deviceSessionId: "device-session",
|
||||
acquisitionId: "acquisition-quick",
|
||||
},
|
||||
capabilities: { defaultVisible: true, overlay: true },
|
||||
};
|
||||
const projected = pendingLiveCameraPresentationDiagnostics(
|
||||
[camera],
|
||||
new Set(),
|
||||
new Set(),
|
||||
);
|
||||
assert.deepEqual(projected.map(({ event }) => event), [{
|
||||
eventCode: "live_camera_source_projected",
|
||||
streamId: "camera-preview-2",
|
||||
}]);
|
||||
|
||||
const emitted = new Set(projected.map(({ key }) => key));
|
||||
const admitted = pendingLiveCameraPresentationDiagnostics(
|
||||
[camera],
|
||||
new Set([camera.id]),
|
||||
emitted,
|
||||
);
|
||||
assert.deepEqual(admitted.map(({ event }) => event), [{
|
||||
eventCode: "live_camera_window_admitted",
|
||||
streamId: "camera-preview-2",
|
||||
}]);
|
||||
admitted.forEach(({ key }) => emitted.add(key));
|
||||
assert.deepEqual(
|
||||
pendingLiveCameraPresentationDiagnostics([camera], new Set([camera.id]), emitted),
|
||||
[],
|
||||
);
|
||||
assert.deepEqual(
|
||||
pendingLiveCameraPresentationDiagnostics(
|
||||
[{ ...camera, delivery: null }],
|
||||
new Set([camera.id]),
|
||||
new Set(),
|
||||
),
|
||||
[],
|
||||
);
|
||||
});
|
||||
|
||||
test("workspace layout API uses the canonical endpoint and optimistic revision", async () => {
|
||||
const calls = [];
|
||||
const current = decodeObservationWorkspaceLayoutProfile(wireProfile());
|
||||
|
||||
Reference in New Issue
Block a user