mirror of
https://github.com/servo/servo.git
synced 2025-08-21 21:35:32 +01:00
Update web-platform-tests to revision e426a6933a05bf144eba06a1d4c47ba876a4e2d1
This commit is contained in:
parent
415b26e4f1
commit
5e5eccabf8
495 changed files with 14920 additions and 784 deletions
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Test frame detach in shared worker's error handler</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<body>
|
||||
<iframe id="frame"></iframe>
|
||||
</body>
|
||||
<script>
|
||||
promise_test(t => {
|
||||
const frame = document.getElementById('frame');
|
||||
|
||||
const promise = new Promise(resolve => {
|
||||
window.detachFrame = () => {
|
||||
frame.remove();
|
||||
resolve();
|
||||
};
|
||||
});
|
||||
|
||||
// Start a new worker with an invalid script in the frame, and detach the
|
||||
// frame in the worker's error handler. This shouldn't crash.
|
||||
const s = frame.contentWindow.document.createElement('script');
|
||||
s.innerHTML = "const worker = new SharedWorker('error');" +
|
||||
"worker.onerror = () => { window.parent.detachFrame(); };";
|
||||
frame.contentWindow.document.body.appendChild(s);
|
||||
|
||||
return promise;
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue