Files
ladybird/Tests/LibWeb/Text/input/video-gc.html
Timothy Flynn f6407276f7 LibWeb: Stop the video decoder thread when the video element is GC'd
Otherwise, the thread will continue to run and access the media data
buffer, which will have been freed.

The test here is a bit strange, but the issue would only consistently
repro after several GC runs.
2024-04-26 09:49:11 +02:00

26 lines
627 B
HTML

<iframe id=iframe></iframe>
<script src="include.js"></script>
<script>
function navigateIframe(src) {
return new Promise(resolve => {
iframe.addEventListener("load", () => {
resolve();
});
iframe.src = src;
});
}
asyncTest(async done => {
await navigateIframe("../data/video-gc-frame.html");
await navigateIframe("../data/iframe-test-content-1.html");
iframe.remove();
for (let i = 0; i < 5; ++i) {
internals.gc();
}
println("PASS (didn't crash)");
done();
});
</script>