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

Side by Side Diff: content/test/data/media/getusermedia.html

Issue 2365883002: Expose the MediaStream interface (Closed)
Patch Set: drop TODO Created 4 years, 2 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
« no previous file with comments | « no previous file | content/test/data/media/peerconnection-call.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script type="text/javascript" src="webrtc_test_utilities.js"></script> 3 <script type="text/javascript" src="webrtc_test_utilities.js"></script>
4 <script type="text/javascript"> 4 <script type="text/javascript">
5 $ = function(id) { 5 $ = function(id) {
6 return document.getElementById(id); 6 return document.getElementById(id);
7 }; 7 };
8 8
9 setAllEventsOccuredHandler(function() { 9 setAllEventsOccuredHandler(function() {
10 reportTestSuccess(); 10 reportTestSuccess();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 }); 69 });
70 }, 70 },
71 failedCallback); 71 failedCallback);
72 } 72 }
73 73
74 function renderDuplicatedMediastreamAndStop(constraints, waitTimeInSeconds) { 74 function renderDuplicatedMediastreamAndStop(constraints, waitTimeInSeconds) {
75 console.log('Calling renderDuplicateMediastreamAndStop.'); 75 console.log('Calling renderDuplicateMediastreamAndStop.');
76 navigator.webkitGetUserMedia( 76 navigator.webkitGetUserMedia(
77 constraints, 77 constraints,
78 function(stream) { 78 function(stream) {
79 var duplicate = new webkitMediaStream(stream); 79 var duplicate = new MediaStream(stream);
80 assertEquals(stream.getVideoTracks().length, 1); 80 assertEquals(stream.getVideoTracks().length, 1);
81 assertEquals(duplicate.getVideoTracks().length, 1); 81 assertEquals(duplicate.getVideoTracks().length, 1);
82 assertEquals(stream.getVideoTracks()[0].id, 82 assertEquals(stream.getVideoTracks()[0].id,
83 duplicate.getVideoTracks()[0].id); 83 duplicate.getVideoTracks()[0].id);
84 detectVideoInLocalView1( 84 detectVideoInLocalView1(
85 duplicate, 85 duplicate,
86 function() { 86 function() {
87 reportTestSuccess(); 87 reportTestSuccess();
88 }); 88 });
89 }, 89 },
90 failedCallback); 90 failedCallback);
91 } 91 }
92 92
93 function renderSameTrackMediastreamAndStop(constraints, waitTimeInSeconds) { 93 function renderSameTrackMediastreamAndStop(constraints, waitTimeInSeconds) {
94 console.log('Calling renderSameTrackMediastreamAndStop.'); 94 console.log('Calling renderSameTrackMediastreamAndStop.');
95 navigator.webkitGetUserMedia( 95 navigator.webkitGetUserMedia(
96 constraints, 96 constraints,
97 function(stream) { 97 function(stream) {
98 var duplicate = new webkitMediaStream(); 98 var duplicate = new MediaStream();
99 duplicate.addTrack(stream.getVideoTracks()[0]); 99 duplicate.addTrack(stream.getVideoTracks()[0]);
100 assertEquals(duplicate.getVideoTracks().length, 1); 100 assertEquals(duplicate.getVideoTracks().length, 1);
101 assertEquals(duplicate.getVideoTracks().length, 1); 101 assertEquals(duplicate.getVideoTracks().length, 1);
102 assertEquals(stream.getVideoTracks()[0].id, 102 assertEquals(stream.getVideoTracks()[0].id,
103 duplicate.getVideoTracks()[0].id); 103 duplicate.getVideoTracks()[0].id);
104 detectVideoInLocalView1( 104 detectVideoInLocalView1(
105 duplicate, 105 duplicate,
106 function() { 106 function() {
107 reportTestSuccess(); 107 reportTestSuccess();
108 }); 108 });
109 }, 109 },
110 failedCallback); 110 failedCallback);
111 } 111 }
112 112
113 function renderClonedTrackMediastreamAndStop(constraints, waitTimeInSeconds) { 113 function renderClonedTrackMediastreamAndStop(constraints, waitTimeInSeconds) {
114 console.log('Calling renderClonedTrackMediastreamAndStop.'); 114 console.log('Calling renderClonedTrackMediastreamAndStop.');
115 navigator.webkitGetUserMedia( 115 navigator.webkitGetUserMedia(
116 constraints, 116 constraints,
117 function(stream) { 117 function(stream) {
118 var duplicate = new webkitMediaStream(); 118 var duplicate = new MediaStream();
119 duplicate.addTrack(stream.getVideoTracks()[0].clone()); 119 duplicate.addTrack(stream.getVideoTracks()[0].clone());
120 assertEquals(duplicate.getVideoTracks().length, 1); 120 assertEquals(duplicate.getVideoTracks().length, 1);
121 assertEquals(duplicate.getVideoTracks().length, 1); 121 assertEquals(duplicate.getVideoTracks().length, 1);
122 assertNotEquals(stream.getVideoTracks()[0].id, 122 assertNotEquals(stream.getVideoTracks()[0].id,
123 duplicate.getVideoTracks()[0].id) 123 duplicate.getVideoTracks()[0].id)
124 detectVideoInLocalView1( 124 detectVideoInLocalView1(
125 duplicate, 125 duplicate,
126 function() { 126 function() {
127 reportTestSuccess(); 127 reportTestSuccess();
128 }); 128 });
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 attachMediaStream(stream, videoElementName); 361 attachMediaStream(stream, videoElementName);
362 var videoElement = $(videoElementName); 362 var videoElement = $(videoElementName);
363 videoElement.onloadedmetadata = function () { 363 videoElement.onloadedmetadata = function () {
364 detectAspectRatio(callback, videoElement); 364 detectAspectRatio(callback, videoElement);
365 }; 365 };
366 } 366 }
367 367
368 function createAndRenderClone(stream) { 368 function createAndRenderClone(stream) {
369 // TODO(perkj): --use-fake-device-for-media-stream do not currently 369 // TODO(perkj): --use-fake-device-for-media-stream do not currently
370 // work with audio devices and not all bots has a microphone. 370 // work with audio devices and not all bots has a microphone.
371 newStream = new webkitMediaStream(); 371 newStream = new MediaStream();
372 newStream.addTrack(stream.getVideoTracks()[0]); 372 newStream.addTrack(stream.getVideoTracks()[0]);
373 assertEquals(newStream.getVideoTracks().length, 1); 373 assertEquals(newStream.getVideoTracks().length, 1);
374 if (stream.getAudioTracks().length > 0) { 374 if (stream.getAudioTracks().length > 0) {
375 newStream.addTrack(stream.getAudioTracks()[0]); 375 newStream.addTrack(stream.getAudioTracks()[0]);
376 assertEquals(newStream.getAudioTracks().length, 1); 376 assertEquals(newStream.getAudioTracks().length, 1);
377 newStream.removeTrack(newStream.getAudioTracks()[0]); 377 newStream.removeTrack(newStream.getAudioTracks()[0]);
378 assertEquals(newStream.getAudioTracks().length, 0); 378 assertEquals(newStream.getAudioTracks().length, 0);
379 } 379 }
380 380
381 detectVideoInLocalView1(newStream, reportTestSuccess); 381 detectVideoInLocalView1(newStream, reportTestSuccess);
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 </tr> 531 </tr>
532 <tr> 532 <tr>
533 <td><video id="local-view-2" width="320" height="240" autoplay 533 <td><video id="local-view-2" width="320" height="240" autoplay
534 style="display:none"></video></td> 534 style="display:none"></video></td>
535 <td><canvas id="local-view-2-canvas" width="320" height="240" 535 <td><canvas id="local-view-2-canvas" width="320" height="240"
536 style="display:none"></canvas></td> 536 style="display:none"></canvas></td>
537 </tr> 537 </tr>
538 </table> 538 </table>
539 </body> 539 </body>
540 </html> 540 </html>
OLDNEW
« no previous file with comments | « no previous file | content/test/data/media/peerconnection-call.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698