Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /mediacapture-record/MediaRecorder-detached-context.html - WPT Dashboard Interop Dashboard
<!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>