LayoutTests/imported/w3c:
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / mediacapture-record / MediaRecorder-constructor.html
1 <!doctype html>
2 <title>MediaRecorder constructor</title>
3 <link rel="help" href="https://w3c.github.io/mediacapture-record/MediaRecorder.html#mediarecorder">
4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script>
6 <script>
7     test(function() {
8         assert_equals(MediaRecorder.length, 1);
9         assert_throws(new TypeError, function() {
10             new MediaRecorder();
11         });
12         assert_throws(new TypeError, function() {
13             new MediaRecorder(null);
14         });
15         assert_throws(new TypeError, function() {
16             new MediaRecorder(undefined);
17         });
18     }, "The MediaStream argument is required");
19
20     test(function() {
21         var context = new AudioContext();
22         var dest = context.createMediaStreamDestination();
23         var recorder = new MediaRecorder(dest.stream);
24         assert_equals(recorder.state, "inactive");
25     }, "The MediaStream instance's state attribute is set.");
26 </script>