This commit is contained in:
2026-09-29 14:54:06 +02:00
parent f7c0c38ec2
commit 5cb0ba631e
6 changed files with 462 additions and 166 deletions
+16
View File
@@ -48,3 +48,19 @@ test('manual playback stops do not advance and unload restores playback', () =>
const wrapper = h.Timeline.loop; h.api.removeStageAutoplay();
assert.notEqual(h.Timeline.loop, wrapper);
});
test('autoplay overrides global looping for once stages and restores it even on failure', () => {
const h = harness(); h.api.removeStageAutoplay();
h.BarItems = { looped_animation_playback: { value: true } };
h.Timeline.loop = function() { if (!h.BarItems.looped_animation_playback.value) this.playing = false; };
const first = h.clip('example.p1'), next = h.clip('example.p2');
h.Animation.selected = first; h.Animation.all = [first, next];
h.api.installStageAutoplay(); h.Timeline.loop();
assert.equal(h.Animation.selected, next);
assert.equal(h.BarItems.looped_animation_playback.value, true);
h.api.removeStageAutoplay();
h.Timeline.loop = () => { throw new Error('preview failed'); };
h.api.installStageAutoplay();
assert.throws(() => h.Timeline.loop(), /preview failed/);
assert.equal(h.BarItems.looped_animation_playback.value, true);
});