off-thread-02.js (588B)
1 // |jit-test| --code-coverage; --no-ion; skip-if: helperThreadCount() === 0 2 3 assertEq(isLcovEnabled(), true); 4 5 offThreadCompileModuleToStencil(` 6 globalThis.hitCount = 0; 7 function offThreadFun() { 8 globalThis.hitCount += 1; 9 } 10 11 offThreadFun(); 12 offThreadFun(); 13 offThreadFun(); 14 offThreadFun(); 15 `); 16 let stencil = finishOffThreadStencil(); 17 let mod = instantiateModuleStencil(stencil); 18 moduleLink(mod); 19 moduleEvaluate(mod); 20 assertEq(hitCount, 4); 21 22 const expected = "FNDA:4,offThreadFun"; 23 24 let report = getLcovInfo(); 25 assertEq(report.includes(expected), true);