blob: 2453b3e6e5f7313e4839e64c2e33cc6a321b3509 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../../resources/js-test.js"></script>
<script src="../resources/audiocontext-leak-test.js"></script>
<script>
description("Makes sure that the OfflineAudioContext objects are not leaking when suspended.");
jsTestIsAsync = true;
const instancesToCreate = 100;
let suspendPromises = [];
for (let i = 0; i < instancesToCreate; i++) {
let context = new OfflineAudioContext(2, 44100, 44100);
trackContextForLeaks(context);
suspendPromises.push(context.suspend(0.5));
context.startRendering();
}
Promise.all(suspendPromises).then((values) => {
gcAndCheckForContextLeaks();
});
</script>
</body>
</html>