test: worker should be able to load asar files (#28858)

This commit is contained in:
Cheng Zhao 2021-04-28 01:07:05 +09:00 committed by GitHub
parent 72092c2312
commit b97b973306
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,15 @@
<script>
function loadSharedWorker(url) {
return new Promise((resolve) => {
try {
const w = new SharedWorker(url);
w.onerror = () => resolve('failed');
w.port.onmessage = (m) => resolve(m.data);
w.port.postMessage('success');
} catch {
resolve('failed');
}
});
}
</script>