OLD | NEW |
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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 // current execution context, but after reportTestSuccess is | 327 // current execution context, but after reportTestSuccess is |
328 // invoked. | 328 // invoked. |
329 setTimeout(function () { | 329 setTimeout(function () { |
330 window.parent.reportTestSuccess(); | 330 window.parent.reportTestSuccess(); |
331 }, 0); | 331 }, 0); |
332 }); | 332 }); |
333 } | 333 } |
334 } | 334 } |
335 | 335 |
336 function failedCallback(error) { | 336 function failedCallback(error) { |
337 failTest('GetUserMedia call failed with code ' + error.code); | 337 failTest('GetUserMedia call failed with error name ' + error.name); |
338 } | 338 } |
339 | 339 |
340 function attachMediaStream(stream, videoElement) { | 340 function attachMediaStream(stream, videoElement) { |
341 var localStreamUrl = URL.createObjectURL(stream); | 341 var localStreamUrl = URL.createObjectURL(stream); |
342 $(videoElement).src = localStreamUrl; | 342 $(videoElement).src = localStreamUrl; |
343 } | 343 } |
344 | 344 |
345 function detectVideoInLocalView1(stream, callback) { | 345 function detectVideoInLocalView1(stream, callback) { |
346 attachMediaStream(stream, 'local-view-1'); | 346 attachMediaStream(stream, 'local-view-1'); |
347 detectVideoPlaying('local-view-1', callback); | 347 detectVideoPlaying('local-view-1', callback); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 // Allow maxLightGreenPixelsY = maxLightGreenPixelsX +-1 due to | 495 // Allow maxLightGreenPixelsY = maxLightGreenPixelsX +-1 due to |
496 // possible subpixel rendering on Mac and Android. | 496 // possible subpixel rendering on Mac and Android. |
497 if (maxLightGreenPixelsY > maxLightGreenPixelsX + 1 || | 497 if (maxLightGreenPixelsY > maxLightGreenPixelsX + 1 || |
498 maxLightGreenPixelsY < maxLightGreenPixelsX -1 || | 498 maxLightGreenPixelsY < maxLightGreenPixelsX -1 || |
499 maxLightGreenPixelsY == 0 || | 499 maxLightGreenPixelsY == 0 || |
500 maxLightGreenPixelsX == width / 2 || | 500 maxLightGreenPixelsX == width / 2 || |
501 maxLightGreenPixelsY == height / 2) { | 501 maxLightGreenPixelsY == height / 2) { |
502 if (++attempt > maxAttempts) { | 502 if (++attempt > maxAttempts) { |
503 clearInterval(detectorInterval); | 503 clearInterval(detectorInterval); |
504 failTest("Aspect ratio corrupted. X " + maxLightGreenPixelsX + | 504 failTest("Aspect ratio corrupted. X " + maxLightGreenPixelsX + |
505 " Y " + maxLightGreenPixelsY); | 505 " Y " + maxLightGreenPixelsY + " width " + width + |
| 506 " height " + height); |
506 } | 507 } |
507 else { | 508 else { |
508 // We have a bad aspect ratio now; give a chance to shape up. | 509 // We have a bad aspect ratio now; give a chance to shape up. |
509 return; | 510 return; |
510 } | 511 } |
511 } | 512 } |
512 | 513 |
513 clearInterval(detectorInterval); | 514 clearInterval(detectorInterval); |
514 var result = "w=" + width + ":h=" + height; | 515 var result = "w=" + width + ":h=" + height; |
515 callback(result); | 516 callback(result); |
(...skipping 13 matching lines...) Expand all Loading... |
529 </tr> | 530 </tr> |
530 <tr> | 531 <tr> |
531 <td><video id="local-view-2" width="320" height="240" autoplay | 532 <td><video id="local-view-2" width="320" height="240" autoplay |
532 style="display:none"></video></td> | 533 style="display:none"></video></td> |
533 <td><canvas id="local-view-2-canvas" width="320" height="240" | 534 <td><canvas id="local-view-2-canvas" width="320" height="240" |
534 style="display:none"></canvas></td> | 535 style="display:none"></canvas></td> |
535 </tr> | 536 </tr> |
536 </table> | 537 </table> |
537 </body> | 538 </body> |
538 </html> | 539 </html> |
OLD | NEW |