fix(observation): admit bounded LAB chunk coverage
This commit is contained in:
@@ -133,6 +133,7 @@ test("session catalog decodes canonical snake_case into a path-free camelCase mo
|
||||
durationSeconds: 1_450.744,
|
||||
replayable: true,
|
||||
preparation: null,
|
||||
lab: null,
|
||||
}]);
|
||||
assert.equal("raw_capture" in catalog.items[0], false);
|
||||
assert.equal("path" in catalog.items[0], false);
|
||||
|
||||
@@ -42,6 +42,7 @@ test("a first frame reports buffer telemetry but is not ready for presentation",
|
||||
const firstFrame = recordedPlaybackBufferState({ min: 0, max: 0 }, 20);
|
||||
assert.deepEqual(firstFrame, {
|
||||
bufferedEndNs: 0,
|
||||
expectedStartNs: 0,
|
||||
expectedEndNs: 20_000_000_000,
|
||||
bufferProgress: 0,
|
||||
fullyBuffered: false,
|
||||
@@ -58,6 +59,7 @@ test("host timeline remains unmounted until the verified recording is fully read
|
||||
currentNs: 0,
|
||||
playing: false,
|
||||
bufferedEndNs: 5,
|
||||
expectedStartNs: 0,
|
||||
expectedEndNs: 10,
|
||||
bufferProgress: 0.5,
|
||||
fullyBuffered: false,
|
||||
@@ -77,6 +79,7 @@ test("host timeline remains unmounted until the verified recording is fully read
|
||||
test("buffer progress grows independently and preserves the full-buffer tolerance", () => {
|
||||
assert.deepEqual(recordedPlaybackBufferState({ min: 0, max: 5_000_000_000 }, 20), {
|
||||
bufferedEndNs: 5_000_000_000,
|
||||
expectedStartNs: 0,
|
||||
expectedEndNs: 20_000_000_000,
|
||||
bufferProgress: 0.25,
|
||||
fullyBuffered: false,
|
||||
@@ -97,14 +100,37 @@ test("buffer progress grows independently and preserves the full-buffer toleranc
|
||||
{ min: 0, max: 19_999_500_000 },
|
||||
);
|
||||
|
||||
const wrongDeclaredStart = recordedPlaybackBufferState(
|
||||
const missingDeclaredStart = recordedPlaybackBufferState(
|
||||
{ min: 5_000_000_000, max: 20_000_000_000 },
|
||||
20,
|
||||
0,
|
||||
);
|
||||
assert.equal(wrongDeclaredStart.bufferProgress, 1);
|
||||
assert.equal(wrongDeclaredStart.fullyBuffered, false);
|
||||
assert.equal(isRecordedPlaybackReady(true, true, wrongDeclaredStart), false);
|
||||
assert.equal(missingDeclaredStart.bufferProgress, 1);
|
||||
assert.equal(missingDeclaredStart.fullyBuffered, false);
|
||||
assert.equal(isRecordedPlaybackReady(true, true, missingDeclaredStart), false);
|
||||
});
|
||||
|
||||
test("a verified split boundary spill covers and clamps the declared LAB window", () => {
|
||||
const actualRange = {
|
||||
min: 34_756_228_209,
|
||||
max: 95_383_857_292,
|
||||
};
|
||||
const buffer = recordedPlaybackBufferState(
|
||||
actualRange,
|
||||
95.383857292,
|
||||
35.421857292,
|
||||
);
|
||||
|
||||
assert.equal(buffer.bufferProgress, 1);
|
||||
assert.equal(buffer.fullyBuffered, true);
|
||||
assert.equal(isRecordedPlaybackReady(true, true, buffer), true);
|
||||
assert.deepEqual(
|
||||
recordedPlaybackRangeWhenReady(actualRange, buffer, true),
|
||||
{
|
||||
min: 35_421_857_292,
|
||||
max: 95_383_857_292,
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
test("recorded autoplay waits for the full range and then runs exactly once", () => {
|
||||
|
||||
Reference in New Issue
Block a user