Skip to content

Commit

Permalink
Test that MediaRecorder.start() throws if MediaRecorder.stream is ina…
Browse files Browse the repository at this point in the history
…ctive.

Differential Revision: https://phabricator.services.mozilla.com/D41587

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1514158
gecko-commit: c60d1d4fe9f44743cbface9d892a6b04bce9106e
gecko-integration-branch: autoland
gecko-reviewers: bryce
  • Loading branch information
Pehrsons authored and moz-wptsync-bot committed Oct 4, 2019
1 parent 32ad773 commit f4483de
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions mediacapture-record/MediaRecorder-events-and-exceptions.html
Expand Up @@ -82,11 +82,11 @@

assert_throws("NotSupportedError",
function() {
recorder =
new MediaRecorder(stream, {mimeType : "video/invalid"});
recorder = new MediaRecorder(
new MediaStream(), {mimeType : "video/invalid"});
},
"recorder should throw() with unsupported mimeType");
let recorder = new MediaRecorder(stream);
let recorder = new MediaRecorder(new MediaStream());
assert_equals(recorder.state, "inactive");

recorder.stop();
Expand All @@ -98,6 +98,14 @@
assert_throws("InvalidStateError", function(){recorder.requestData()},
"cannot requestData() if recorder is in |inactive| state");

assert_throws("NotSupportedError",
function() {
recorder.start();
},
"recorder should throw() when starting with inactive stream");

recorder.stream.addTrack(stream.getTracks()[0]);

drawSomethingOnCanvas();

recorder.onstop = recorderOnUnexpectedEvent;
Expand Down

0 comments on commit f4483de

Please sign in to comment.