Recover stalled platform progress and missing saves with bounded reloads
This commit is contained in:
@@ -45,10 +45,10 @@ function site(h){
|
||||
const h=harness();h.api.begin();visibility(h,'hidden');h.advance(61000);
|
||||
const lease=JSON.parse(h.storage.get('icampus.study.v1.lease'));assert.ok(lease.until>h.context.Date.now());
|
||||
});
|
||||
await test('background delay allows a real heartbeat to arrive but missing saves still stop',()=>{
|
||||
await test('background delay allows a real heartbeat to arrive before missing saves refresh',()=>{
|
||||
const h=harness();h.api.begin();h.api.track(h.video);visibility(h,'hidden');
|
||||
h.advance(80000);h.video.currentTime+=160;h.api.monitor();assert.equal(h.api.state.running,true);
|
||||
h.advance(101000);h.video.currentTime+=202;h.api.monitor();assert.equal(h.api.state.running,false);assert.match(h.api.state.status,/180秒/);
|
||||
h.advance(101000);h.video.currentTime+=202;h.api.monitor();assert.equal(h.api.state.running,false);assert.match(h.api.state.status,/180秒/);assert.equal(h.context.location.reloadCount,1);
|
||||
});
|
||||
await test('foreground return gives the restarted heartbeat 20 seconds to respond',()=>{
|
||||
const h=harness();h.api.begin();h.api.track(h.video);visibility(h,'hidden');h.advance(80000);visibility(h,'visible');
|
||||
|
||||
Reference in New Issue
Block a user