forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1646601 add crashtest with AudioContext after unload r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D84300
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
dom/media/test/crashtests/audiocontext-after-unload-1.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html class="reftest-wait"> | ||
<head> | ||
<title>Test for bug 1646601</title> | ||
<script> | ||
document.addEventListener('DOMContentLoaded', async () => { | ||
const frame = document.createElement('iframe'); | ||
document.body.appendChild(frame); | ||
frame.srcdoc = '<html></html>'; | ||
await new Promise(resolve => frame.onload = resolve); | ||
const subwin = frame.contentWindow; | ||
const subcontext = subwin.AudioContext; | ||
// Construct an AudioContext while the subdocument is fully active to start | ||
// a MediaTrackGraph. | ||
new subcontext(); | ||
// Unload the subdocument and wait for completion. | ||
// This shuts down the MediaTrackGraph. | ||
subwin.location.reload(); | ||
await new Promise(resolve => frame.onload = resolve); | ||
// Test that a new AudioContext on the inactive subdocument does not attempt | ||
// to use the shut-down MediaTrackGraph. | ||
try { new subcontext() } catch {} | ||
document.documentElement.removeAttribute('class'); | ||
}); | ||
</script> | ||
</head> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters