Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(954)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getSources.html

Issue 2493823002: Revert of Revert "Remove MediaStreamTrack.getSources()." (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.");
11
12 var sources = null;
13 var previousId;
14
15 function error() {
16 testFailed('Stream generation failed.');
17 finishJSTest();
18 }
19
20 function getUserMedia(constraints, callback) {
21 try {
22 navigator.webkitGetUserMedia(constraints, callback, error);
23 } catch (e) {
24 testFailed('webkitGetUserMedia threw exception :' + e);
25 finishJSTest();
26 }
27 }
28
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');
35
36 finishJSTest();
37 }
38
39 function gotStream(s) {
40 testPassed('gotStream was called.');
41
42 shouldNotThrow('MediaStreamTrack.getSources(gotSources2);');
43 }
44
45 function gotSources1(s) {
46 testPassed('gotSources1 was called.');
47 sources = s;
48 shouldBeTrue('sources.length > 0');
49 previousId = sources[0].id;
50
51 getUserMedia({audio:true, video:true}, gotStream);
52 }
53
54 shouldNotThrow('MediaStreamTrack.getSources(gotSources1);');
55
56 window.jsTestIsAsync = true;
57 window.successfullyParsed = true;
58 </script>
59 </body>
60 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698