<!doctype html>
<html>
<head>
  <title>MediaRecorder Start</title>
  <link rel="help" href="https://w3c.github.io/mediacapture-record/MediaRecorder.html#dom-mediarecorder-start">
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
</head>
<body>
<canvas id="canvas" width="200" height="200">
</canvas>
<script>
    function createVideoStream() {
        canvas.getContext('2d');
        return canvas.captureStream();
    }

    test(t => {
        const mimeType = [ 'audio/aac', 'audio/ogg', 'audio/webm' ].find(MediaRecorder.isTypeSupported);
        const mediaRecorder = new MediaRecorder(createVideoStream(), {mimeType});
        assert_throws_dom("NotSupportedError", () => mediaRecorder.start());
    }, "MediaRecorder cannot record the stream using the current configuration");
</script>
</body>
</html>
