Resume offline preparation on launch and show cache readiness
This commit is contained in:
@@ -84,3 +84,14 @@ test('classic chunk registry proxies use window.YT and keep the executed singlet
|
||||
const singleton=root.YT.TestApi;await root.Lazy.load('feature:test');
|
||||
assert.equal(root.YT.TestApi,singleton);assert.equal(inserted.length,2);
|
||||
});
|
||||
|
||||
|
||||
test('online launches request worker completion even with Save-Data and skip offline messages',async()=>{
|
||||
const f=fixture(),sent=[];
|
||||
const active={postMessage:m=>sent.push(m)},waiting={postMessage:m=>sent.push(m)};
|
||||
f.root.navigator.connection={saveData:true};f.root.navigator.onLine=true;
|
||||
f.root.navigator.serviceWorker={ready:Promise.resolve({active,waiting})};
|
||||
f.root.Lazy.warm();await Promise.resolve();
|
||||
assert.deepEqual(sent.map(m=>m.type),['COMPLETE_ASSETS','COMPLETE_ASSETS']);
|
||||
f.root.navigator.onLine=false;f.root.Lazy.warm();await Promise.resolve();assert.equal(sent.length,2);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user