Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / mediastream / MediaStreamTrack-getSources.html
blob4dcbeceb4e396164220e8156b45e5dfb49d94a8f
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 MediaStreamTrack::getSources.");
12 var sources = null;
13 var previousId;
15 function error() {
16 testFailed('Stream generation failed.');
17 finishJSTest();
20 function getUserMedia(constraints, callback) {
21 try {
22 navigator.webkitGetUserMedia(constraints, callback, error);
23 } catch (e) {
24 testFailed('webkitGetUserMedia threw exception :' + e);
25 finishJSTest();
29 function gotSources2(s) {
30 testPassed('gotSources2 was called.');
31 sources = s;
32 shouldBeTrue('sources.length > 0');
33 shouldBeTrue('sources[0].id === previousId');
34 shouldBeTrue('sources[0].label.length > 0');
36 finishJSTest();
39 function gotStream(s) {
40 testPassed('gotStream was called.');
42 shouldNotThrow('MediaStreamTrack.getSources(gotSources2);');
45 function gotSources1(s) {
46 testPassed('gotSources1 was called.');
47 sources = s;
48 shouldBeTrue('sources.length > 0');
49 previousId = sources[0].id;
51 getUserMedia({audio:true, video:true}, gotStream);
54 shouldNotThrow('MediaStreamTrack.getSources(gotSources1);');
56 window.jsTestIsAsync = true;
57 window.successfullyParsed = true;
58 </script>
59 </body>
60 </html>