fix(viewer): make recorded layers deterministic
This commit is contained in:
@@ -128,6 +128,51 @@ test("recorded autoplay waits for the full range and then runs exactly once", ()
|
||||
assert.equal(gate.attempted(), true);
|
||||
});
|
||||
|
||||
test("recorded autoplay starts at the first presentable camera frame without shrinking the range", () => {
|
||||
const gate = createRecordedAutoplayGate();
|
||||
const seeks = [];
|
||||
const range = { min: 0, max: 535_717_620_042 };
|
||||
|
||||
assert.equal(gate.attempt(
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
range,
|
||||
(value) => seeks.push(value),
|
||||
() => {},
|
||||
35_421_857_292,
|
||||
), true);
|
||||
assert.deepEqual(seeks, [35_421_857_292]);
|
||||
assert.deepEqual(range, { min: 0, max: 535_717_620_042 });
|
||||
});
|
||||
|
||||
test("recorded autoplay clamps an invalid presentation start to the admitted archive", () => {
|
||||
const before = createRecordedAutoplayGate();
|
||||
const after = createRecordedAutoplayGate();
|
||||
const seeks = [];
|
||||
const range = { min: 5, max: 10 };
|
||||
|
||||
assert.equal(before.attempt(
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
range,
|
||||
(value) => seeks.push(value),
|
||||
() => {},
|
||||
-50,
|
||||
), true);
|
||||
assert.equal(after.attempt(
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
range,
|
||||
(value) => seeks.push(value),
|
||||
() => {},
|
||||
50,
|
||||
), true);
|
||||
assert.deepEqual(seeks, [5, 10]);
|
||||
});
|
||||
|
||||
test("a failed vendor autoplay attempt is consumed instead of rewinding later", () => {
|
||||
const gate = createRecordedAutoplayGate();
|
||||
let seeks = 0;
|
||||
|
||||
Reference in New Issue
Block a user