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

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

Issue 2108153002: Do not wait for first video frame to start playing audio in a MediaStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 4 years, 5 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/webmediaplayer_ms.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 <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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 453
454 var maxLightGreenPixelsX = 0; 454 var maxLightGreenPixelsX = 0;
455 var maxLightGreenPixelsY = 0; 455 var maxLightGreenPixelsY = 0;
456 456
457 var attempt = 0; 457 var attempt = 0;
458 var maxAttempts = 10; 458 var maxAttempts = 10;
459 459
460 var detectorFunction = function() { 460 var detectorFunction = function() {
461 var width = videoElement.videoWidth; 461 var width = videoElement.videoWidth;
462 var height = videoElement.videoHeight; 462 var height = videoElement.videoHeight;
463 if (width == 0 || height == 0) 463 if (width == 0 || height == 0) {
464 failTest("VideoElement width and height set to 0."); 464 if (++attempt > maxAttempts) {
465 clearInterval(detectorInterval);
466 failTest("VideoElement width or height set to 0.");
467 }
468 else {
469 // We have zero size now; give a chance to shape up.
470 return;
471 }
472 }
465 473
466 canvas.width = width; 474 canvas.width = width;
467 canvas.height = height; 475 canvas.height = height;
468 var aperture = Math.min(width, height) / 2; 476 var aperture = Math.min(width, height) / 2;
469 var context = canvas.getContext('2d'); 477 var context = canvas.getContext('2d');
470 context.drawImage(videoElement, 0, 0, width, height); 478 context.drawImage(videoElement, 0, 0, width, height);
471 479
472 // We are interested in a window starting from the center of the image 480 // We are interested in a window starting from the center of the image
473 // where we expect the circle from the fake video capture to be rolling. 481 // where we expect the circle from the fake video capture to be rolling.
474 var pixels = context.getImageData(width / 2, height / 2, 482 var pixels = context.getImageData(width / 2, height / 2,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 </tr> 538 </tr>
531 <tr> 539 <tr>
532 <td><video id="local-view-2" width="320" height="240" autoplay 540 <td><video id="local-view-2" width="320" height="240" autoplay
533 style="display:none"></video></td> 541 style="display:none"></video></td>
534 <td><canvas id="local-view-2-canvas" width="320" height="240" 542 <td><canvas id="local-view-2-canvas" width="320" height="240"
535 style="display:none"></canvas></td> 543 style="display:none"></canvas></td>
536 </tr> 544 </tr>
537 </table> 545 </table>
538 </body> 546 </body>
539 </html> 547 </html>
OLDNEW
« no previous file with comments | « content/renderer/media/webmediaplayer_ms.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698