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

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

Issue 2325833002: Handle frames sent from peer connection in VideoTrackRecorder (Closed)
Patch Set: Created 4 years, 3 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 | « content/renderer/media/video_track_recorder.cc ('k') | no next file » | 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> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>MediaStream Recoder Browser Test (w/ MediaSource)</title> 4 <title>MediaStream Recoder Browser Test (w/ MediaSource)</title>
5 </head> 5 </head>
6 <body> 6 <body>
7 <div> Record Real-Time video content browser test.</div> 7 <div> Record Real-Time video content browser test.</div>
8 <video id="video" autoplay></video> 8 <video id="video" autoplay></video>
9 <video id="remoteVideo" autoplay></video> 9 <video id="remoteVideo" autoplay></video>
10 </body> 10 </body>
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 .then(function(stream) { 406 .then(function(stream) {
407 return createMediaRecorder(stream, DEFAULT_RECORDER_MIME_TYPE); 407 return createMediaRecorder(stream, DEFAULT_RECORDER_MIME_TYPE);
408 }) 408 })
409 .then(function(recorder) { 409 .then(function(recorder) {
410 assertThrows(function() {recorder.pause()}, 'Calling pause() in' + 410 assertThrows(function() {recorder.pause()}, 'Calling pause() in' +
411 ' inactive state should cause a DOM error'); 411 ' inactive state should cause a DOM error');
412 }); 412 });
413 } 413 }
414 414
415 // Tests that a remote peer connection stream can be successfully recorded. 415 // Tests that a remote peer connection stream can be successfully recorded.
416 function testRecordRemotePeerConnection() { 416 function testRecordRemotePeerConnection(codec) {
417 var videoSize = 0; 417 var videoSize = 0;
418 var timeStamps = []; 418 var timeStamps = [];
419 const mimeType = codec ? "video/webm;codecs=" + String(codec) : "";
419 navigator.mediaDevices.getUserMedia(DEFAULT_CONSTRAINTS) 420 navigator.mediaDevices.getUserMedia(DEFAULT_CONSTRAINTS)
420 .then(function(localStream) { 421 .then(function(localStream) {
421 return setupPeerConnection(localStream); 422 return setupPeerConnection(localStream);
422 }) 423 })
423 .then(function(remoteStream) { 424 .then(function(remoteStream) {
424 return createMediaRecorder(remoteStream, DEFAULT_RECORDER_MIME_TYPE); 425 return createMediaRecorder(remoteStream, mimeType);
425 }) 426 })
426 .then(function(recorder) { 427 .then(function(recorder) {
427 recorder.ondataavailable = function(event) { 428 recorder.ondataavailable = function(event) {
428 timeStamps.push(event.timeStamp); 429 timeStamps.push(event.timeStamp);
429 videoSize += event.data.size; 430 videoSize += event.data.size;
430 }; 431 };
431 recorder.start(); 432 recorder.start();
432 }) 433 })
433 .then(function() { 434 .then(function() {
434 return waitFor('Making sure the recording has data', 435 return waitFor('Making sure the recording has data',
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 return failTest(err.toString()); 592 return failTest(err.toString());
592 }) 593 })
593 .then(function() { 594 .then(function() {
594 reportTestSuccess(); 595 reportTestSuccess();
595 }); 596 });
596 } 597 }
597 598
598 </script> 599 </script>
599 </body> 600 </body>
600 </html> 601 </html>
OLDNEW
« no previous file with comments | « content/renderer/media/video_track_recorder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698