Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!doctype html>
<html>
<head>
<title>MediaRecorder Detached Context</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
async_test(t => {
const frame = document.body.appendChild(document.createElement('iframe'));
const recorderFunc = frame.contentWindow.MediaRecorder;
frame.remove();
try {
new recorderFunc(new MediaStream);
} catch (err) {
assert_equals(err.name, 'NotSupportedError');
t.done();
}
assert_unreached('MediaRecorder should have failed');
}, 'MediaRecorder creation with detached context');
</script>
</body>
</html>