Recover stalled platform progress and missing saves with bounded reloads
This commit is contained in:
@@ -112,11 +112,11 @@ if (require.main === module) (async () => {
|
||||
const h=harness(); h.api.begin(); h.api.track(h.video); h.video.playbackRate=1; h.api.monitor();
|
||||
assert.equal(h.api.state.running,false); assert.equal(h.video.playbackRate,1); assert.equal(h.video.paused,true);
|
||||
});
|
||||
await test('ended without server completion never clicks next, then stops on timeout', async () => {
|
||||
await test('ended without server completion never clicks next, then refreshes on timeout', async () => {
|
||||
const h=harness(); h.api.begin(); h.api.track(h.video); h.video.ended=true;
|
||||
await h.api.tickCourse(ID); assert.equal(h.buttons[1].clicks,0);
|
||||
h.advance(26000); await h.api.tickCourse(ID);
|
||||
assert.equal(h.api.state.running,false); assert.equal(h.buttons[1].clicks,0);
|
||||
assert.equal(h.api.state.running,false); assert.equal(h.buttons[1].clicks,0);assert.equal(h.context.location.reloadCount,1);
|
||||
});
|
||||
await test('matching genuine heartbeat plus natural end allows next video', async () => {
|
||||
const h=harness(); h.api.begin(); h.api.track(h.video);
|
||||
@@ -135,9 +135,9 @@ if (require.main === module) (async () => {
|
||||
h.api.receive({id:ID,tail:'sessions'},{bizCode:47235,message:'上一个视频尚未完成'},200);
|
||||
assert.equal(h.api.state.running,false); assert.match(h.api.state.status,/47235/);
|
||||
});
|
||||
await test('missing heartbeat stops even if media continues advancing', () => {
|
||||
await test('missing heartbeat refreshes even if media continues advancing', () => {
|
||||
const h=harness(); h.api.begin(); h.api.track(h.video); h.advance(76000); h.video.currentTime+=100; h.api.monitor();
|
||||
assert.equal(h.api.state.running,false); assert.match(h.api.state.status,/75秒/);
|
||||
assert.equal(h.api.state.running,false); assert.match(h.api.state.status,/75秒/);assert.equal(h.context.location.reloadCount,1);
|
||||
});
|
||||
await test('failed course navigation is bounded', async () => {
|
||||
const h=harness(); h.api.begin(); h.api.pending(); await h.api.tick();
|
||||
|
||||
Reference in New Issue
Block a user