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

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

Issue 216353003: Allow #pixelsX = #pixelsY +-1 to fix WebRtcGetUserMediaBrowserTest.TestGetUserMediaAspectX (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | 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 var gLocalStream = null; 9 var gLocalStream = null;
10 10
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 var lightGreenPixelsX = 0; 333 var lightGreenPixelsX = 0;
334 var lightGreenPixelsY = 0; 334 var lightGreenPixelsY = 0;
335 335
336 // Walk horizontally counting light green pixels. 336 // Walk horizontally counting light green pixels.
337 for (var x = 0; x < aperture; ++x) { 337 for (var x = 0; x < aperture; ++x) {
338 if (pixels.data[4 * x + 1] != COLOR_BACKGROUND_GREEN) 338 if (pixels.data[4 * x + 1] != COLOR_BACKGROUND_GREEN)
339 lightGreenPixelsX++; 339 lightGreenPixelsX++;
340 } 340 }
341 // Walk vertically counting light green pixels. 341 // Walk vertically counting light green pixels.
342 for (var y = 0; y < aperture; ++y) { 342 for (var y = 0; y < aperture; ++y) {
343 if (pixels.data[4 * y * aperture + 1] != 135) 343 if (pixels.data[4 * y * aperture + 1] != COLOR_BACKGROUND_GREEN)
344 lightGreenPixelsY++; 344 lightGreenPixelsY++;
345 } 345 }
346 if (lightGreenPixelsX > maxLightGreenPixelsX) 346 if (lightGreenPixelsX > maxLightGreenPixelsX)
347 maxLightGreenPixelsX = lightGreenPixelsX; 347 maxLightGreenPixelsX = lightGreenPixelsX;
348 if (lightGreenPixelsY > maxLightGreenPixelsY) 348 if (lightGreenPixelsY > maxLightGreenPixelsY)
349 maxLightGreenPixelsY = lightGreenPixelsY; 349 maxLightGreenPixelsY = lightGreenPixelsY;
350 350
351 if (++iterations > maxIterations) { 351 if (++iterations > maxIterations) {
352 clearInterval(detectorInterval); 352 clearInterval(detectorInterval);
353 // Allow maxLightGreenPixelsY = maxLightGreenPixelsX -1 due to sub pixel 353 // Allow maxLightGreenPixelsY = maxLightGreenPixelsX +-1 due to
354 // rendering on Mac. 354 // possible subpixel rendering on Mac and Android.
355 if ((maxLightGreenPixelsY != maxLightGreenPixelsX && 355 if (maxLightGreenPixelsY > maxLightGreenPixelsX + 1 ||
356 maxLightGreenPixelsY != maxLightGreenPixelsX -1) || 356 maxLightGreenPixelsY < maxLightGreenPixelsX -1 ||
357 maxLightGreenPixelsY == 0 || 357 maxLightGreenPixelsY == 0 ||
358 maxLightGreenPixelsX == width || maxLightGreenPixelsY == height) { 358 maxLightGreenPixelsX == width || maxLightGreenPixelsY == height) {
359 failTest("Aspect ratio corrupted. X " + maxLightGreenPixelsX + 359 failTest("Aspect ratio corrupted. X " + maxLightGreenPixelsX +
360 " Y " + maxLightGreenPixelsY); 360 " Y " + maxLightGreenPixelsY);
361 } 361 }
362 362
363 var result = "w=" + width + ":h=" + height; 363 var result = "w=" + width + ":h=" + height;
364 console.log(result); 364 console.log(result);
365 callback(result); 365 callback(result);
366 } 366 }
(...skipping 19 matching lines...) Expand all
386 <tr> 386 <tr>
387 <td><video width="320" height="240" id="local-view-2" 387 <td><video width="320" height="240" id="local-view-2"
388 autoplay="autoplay"></video></td> 388 autoplay="autoplay"></video></td>
389 <!-- Canvases are named after their corresponding video elements. --> 389 <!-- Canvases are named after their corresponding video elements. -->
390 <td><canvas width="320" height="240" id="local-view-2-canvas" 390 <td><canvas width="320" height="240" id="local-view-2-canvas"
391 style="display:none"></canvas></td> 391 style="display:none"></canvas></td>
392 </tr> 392 </tr>
393 </table> 393 </table>
394 </body> 394 </body>
395 </html> 395 </html>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698