Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / mediastream / MediaStream-onended.html
blob3cd40cb337b1c4798f8e9a8e9186e14426b66f23
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9 <script>
10 description("Tests MediaStream::onended callback.");
12 function error() {
13 testFailed('Stream generation failed.');
14 finishJSTest();
17 function getUserMedia(dictionary, callback) {
18 try {
19 navigator.webkitGetUserMedia(dictionary, callback, error);
20 } catch (e) {
21 testFailed('webkitGetUserMedia threw exception :' + e);
22 finishJSTest();
26 var stream;
28 function streamEnded2() {
29 testPassed('streamEnded was called.');
30 shouldBeTrue('stream.ended');
31 finishJSTest();
34 function gotStream2(s) {
35 stream = new webkitMediaStream(s);
36 shouldBeFalse('stream.ended');
37 try {
38 stream.onended = streamEnded2;
39 s.stop();
40 } catch (e) {
41 testFailed('MediaStream threw exception :' + e);
42 finishJSTest();
46 function streamEnded() {
47 testPassed('streamEnded was called.');
48 shouldBeTrue('stream.ended');
50 getUserMedia({audio:true, video:true}, gotStream2);
53 function gotStream(s) {
54 stream = s;
55 shouldBeFalse('stream.ended');
56 try {
57 stream.onended = streamEnded;
58 stream.stop();
59 } catch (e) {
60 testFailed('MediaStream threw exception :' + e);
61 finishJSTest();
65 getUserMedia({audio:true, video:true}, gotStream);
67 window.jsTestIsAsync = true;
68 window.successfullyParsed = true;
69 </script>
70 </body>
71 </html>