1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../resources/js-test.js"></script>
7 <p id=
"description"></p>
8 <div id=
"console"></div>
10 description("Tests MediaStream::onended callback.");
13 testFailed('Stream generation failed.');
17 function getUserMedia(dictionary
, callback
) {
19 navigator
.webkitGetUserMedia(dictionary
, callback
, error
);
21 testFailed('webkitGetUserMedia threw exception :' + e
);
28 function streamEnded2() {
29 testPassed('streamEnded was called.');
30 shouldBeTrue('stream.ended');
34 function gotStream2(s
) {
35 stream
= new webkitMediaStream(s
);
36 shouldBeFalse('stream.ended');
38 stream
.onended
= streamEnded2
;
41 testFailed('MediaStream threw exception :' + e
);
46 function streamEnded() {
47 testPassed('streamEnded was called.');
48 shouldBeTrue('stream.ended');
50 getUserMedia({audio
:true, video
:true}, gotStream2
);
53 function gotStream(s
) {
55 shouldBeFalse('stream.ended');
57 stream
.onended
= streamEnded
;
60 testFailed('MediaStream threw exception :' + e
);
65 getUserMedia({audio
:true, video
:true}, gotStream
);
67 window
.jsTestIsAsync
= true;
68 window
.successfullyParsed
= true;