Skip to content

Commit

Permalink
Bug 1646601 add crashtest with AudioContext after unload r=padenot
Browse files Browse the repository at this point in the history
  • Loading branch information
karlt committed Sep 15, 2020
1 parent 8b05bea commit 6cea4e7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions dom/media/test/crashtests/audiocontext-after-unload-1.html
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>
1 change: 1 addition & 0 deletions dom/media/test/crashtests/crashtests.list
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ load 1411322.html
load 1450845.html
load disconnect-wrong-destination.html
load analyser-channels-1.html
load audiocontext-after-unload-1.html
skip-if(verify&&isDebugBuild&&gtkWidget) load audiocontext-double-suspend.html
skip-if(Android) load audioworkletnode-after-unload-1.html # Needs secure context
load buffer-source-duration-1.html
Expand Down

0 comments on commit 6cea4e7

Please sign in to comment.