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

Side by Side Diff: LayoutTests/fast/mediastream/MediaStreamTrack-getSourceInfos.html

Issue 15796004: [MediaStream API] Adding MediaStreamTrack::getSourceInfos (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed review comments and merge Created 7 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/mediastream/MediaStreamTrack-getSourceInfos-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <link rel="stylesheet" href="../js/resources/js-test-style.css">
4 <script src="../js/resources/js-test-pre.js"></script> 5 <script src="../js/resources/js-test-pre.js"></script>
5 </head> 6 </head>
6 <body> 7 <body>
8 <p id="description"></p>
9 <div id="console"></div>
7 <script> 10 <script>
8 description("Tests RTCPeerConnection onnegotiationneeded."); 11 description("Tests MediaStreamTrack::getSourceInfos.");
9 12
10 var stream = null; 13 var sources = null;
11 var pc = null; 14 var previousId;
12 15
13 function error() { 16 function error() {
14 testFailed('Stream generation failed.'); 17 testFailed('Stream generation failed.');
15 finishJSTest(); 18 finishJSTest();
16 } 19 }
17 20
18 function getUserMedia(dictionary, callback) { 21 function getUserMedia(constraints, callback) {
19 try { 22 try {
20 navigator.webkitGetUserMedia(dictionary, callback, error); 23 navigator.webkitGetUserMedia(constraints, callback, error);
21 } catch (e) { 24 } catch (e) {
22 testFailed('webkitGetUserMedia threw exception :' + e); 25 testFailed('webkitGetUserMedia threw exception :' + e);
23 finishJSTest(); 26 finishJSTest();
24 } 27 }
25 } 28 }
26 29
27 function onNegotiationNeeded(event) { 30 function gotStream(s) {
28 testPassed('onNegotiationNeeded was called.'); 31 shouldNotThrow('sources = MediaStreamTrack.getSourceInfos();');
29 32 shouldBeTrue('sources.length > 0');
33 shouldBeTrue('sources[0].id === previousId');
34 shouldBeTrue('sources[0].label.length > 0');
30 finishJSTest(); 35 finishJSTest();
31 } 36 }
32 37
33 function gotStream(s) { 38 shouldNotThrow('sources = MediaStreamTrack.getSourceInfos();');
34 testPassed('Got a stream.'); 39 shouldBeTrue('sources.length > 0');
35 stream = s; 40 previousId = sources[0].id;
36
37 pc = new webkitRTCPeerConnection(null, null);
38 pc.onnegotiationneeded = onNegotiationNeeded;
39
40 pc.addStream(stream);
41 }
42 41
43 getUserMedia({audio:true, video:true}, gotStream); 42 getUserMedia({audio:true, video:true}, gotStream);
44 43
45 window.jsTestIsAsync = true; 44 window.jsTestIsAsync = true;
46 window.successfullyParsed = true; 45 window.successfullyParsed = true;
47 </script> 46 </script>
48 <script src="../js/resources/js-test-post.js"></script> 47 <script src="../js/resources/js-test-post.js"></script>
49 </body> 48 </body>
50 </html> 49 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/mediastream/MediaStreamTrack-getSourceInfos-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698