blob: 742eba54ff138ce7a5e95613113a1e230207d009 [file] [log] [blame]
let contextIDs = [];
function trackContextForLeaks(context)
{
let contextID = internals.baseAudioContextIdentifier(context);
contextIDs.push(contextID);
// Sanity check.
if (!internals.isBaseAudioContextAlive(contextID))
testFailed("Test harness failure: internals.isBaseAudioContextAlive() is not working as expected!");
}
function didGCAtLeastOneContext()
{
for (let contextID of contextIDs) {
if (!internals.isBaseAudioContextAlive(contextID))
return true;
}
return false;
}
function gcAndCheckForContextLeaks()
{
gc();
setTimeout(() => {
gc();
shouldBeTrue("didGCAtLeastOneContext()");
finishJSTest();
}, 0);
}