Extend JamesDSP with convolution and spatial audio
This commit is contained in:
@@ -56,6 +56,20 @@ test('completion includes ungrouped runtime files and exposes verified missing p
|
||||
assert.equal((await core.status(m,c)).offlineReady,true);
|
||||
});
|
||||
|
||||
test('offline completion skips opt-in DSP assets until the user enables offline audio effects', async () => {
|
||||
const c=cache(),m=manifest();m.files['/vendor/jamesdsp/dsp/jamesdsp.wasm']={h:'wasm'};
|
||||
m.groups.jamesdsp={contract:1,eager:false,background:true,offlineOptIn:'jamesDsp',files:['/vendor/jamesdsp/dsp/jamesdsp.wasm']};
|
||||
const calls=[];
|
||||
const defaultJob=await core.complete(m,{cache:c,fetchFn:async u=>{calls.push(u);return response(u.split('=')[1])}});
|
||||
assert.deepEqual(calls.sort(),['/a.js?v=a','/index.html?v=b']);
|
||||
assert.equal(defaultJob.total,2);assert.equal(defaultJob.offlineReady,true);
|
||||
calls.length=0;
|
||||
await c.put(core.OPT_INS,Response.json(['jamesDsp']));
|
||||
const optedJob=await core.complete(m,{cache:c,fetchFn:async u=>{calls.push(u);return response(u.split('=')[1])}});
|
||||
assert.deepEqual(calls,['/vendor/jamesdsp/dsp/jamesdsp.wasm?v=wasm']);
|
||||
assert.equal(optedJob.total,3);assert.equal(optedJob.offlineReady,true);
|
||||
});
|
||||
|
||||
test('completion persists backoff and resumes only missing files after a worker restart',async()=>{
|
||||
const c=cache(),m=manifest();let clock=1000;const calls=[];
|
||||
await core.complete(m,{cache:c,cycles:1,now:()=>clock,baseDelay:10,fetchFn:async u=>{if(u.includes('index'))throw Error('offline');return response('a');}});
|
||||
|
||||
Reference in New Issue
Block a user