Bug 1811950 - Test. r=saschanaz

Had to do some frame shenanigans to get it to semi-consistently repro.

Differential Revision: https://phabricator.services.mozilla.com/D175131
This commit is contained in:
Emilio Cobos Álvarez 2023-04-11 14:29:12 +00:00
Родитель f93cffb785
Коммит b1cab1b0ee
1 изменённых файлов: 32 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,32 @@
<!doctype html>
<html class="test-wait">
<iframe id="frame" srcdoc=""></iframe>
<script id="worker1" type="javascript/worker">
self.onmessage = async function(e) {
let a = new MessageEvent('message')
for (let e = 0; e < 255; e++) {
new Uint8ClampedArray(2048).fill(e)
}
try { self.dispatchEvent(a) } catch (e) {}
let x = new FontFace('foo', 'x')
}
</script>
<script>
function tick() {
return new Promise(r => {
requestAnimationFrame(() => requestAnimationFrame(r));
});
}
onload = async () => {
let win = document.querySelector("#frame").contentWindow;
const blob = new win.Blob([document.querySelector('#worker1').textContent], { type: "text/javascript" })
let worker = new win.Worker(win.URL.createObjectURL(blob))
worker.postMessage([], [])
await tick();
await tick();
win.location.reload(true)
await tick();
document.documentElement.className = "";
};
</script>