tweaks
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user