test_webcam.html (2207B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=641748 5 6 webcam-simulacrum.mgif is a hand-edited file containing red.gif and blue.gif, 7 concatenated together with the relevant headers for 8 multipart/x-mixed-replace. Specifically, with the headers in 9 webcam-simulacrum.mjpg^headers^, the web browser will get the following: 10 11 HTTP 200 OK 12 Content-Type: multipart/x-mixed-replace;boundary=BOUNDARYOMG 13 14 \-\-BOUNDARYOMG\r\n 15 Content-Type: image/gif\r\n 16 \r\n 17 <contents of red.gif> (no newline) 18 \-\-BOUNDARYOMG\r\n 19 Content-Type: image/gif\r\n 20 \r\n 21 <contents of blue.gif> (no newline) 22 \-\-BOUNDARYOMG\-\-\r\n 23 24 (The boundary is arbitrary, and just has to be defined as something that 25 won't be in the text of the contents themselves. \-\-$(boundary)\r\n means 26 "Here is the beginning of a boundary," and \-\-$(boundary)\-\- means "All done 27 sending you parts.") 28 --> 29 <head> 30 <title>Test for Bug 641748 - WebCam Simulacrum</title> 31 <script src="/tests/SimpleTest/SimpleTest.js"></script> 32 <script src="/tests/SimpleTest/WindowSnapshot.js"></script> 33 <script type="application/javascript" src="imgutils.js"></script> 34 <script type="application/javascript" src="animationPolling.js"></script> 35 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 36 </head> 37 <body> 38 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=641748"> 39 Mozilla Bug 641748: GIF decoder doesn't support multipart/x-mixed-replace 40 </a> 41 <p id="display"></p> 42 43 <div id="content"> 44 <div id="referenceDiv" style="height: 100px; width: 100px; 45 display: none; background: #0018ff;"></div> 46 <div id="animatedImage"> 47 <img id="animatedGif" src="webcam-simulacrum.sjs" style="display: none; height: 100px; width: 100px;"> 48 <div id="text-descr"></div> 49 </div> 50 <div id="debug" style="display:none"> 51 </div> 52 </div> 53 <pre id="test"> 54 <script type="text/javascript"> 55 const FAILURE_TIMEOUT = 60000; // Fail early after 60 seconds 56 57 function main() 58 { 59 var animTest = new AnimationTest(20, FAILURE_TIMEOUT, 'referenceDiv', 60 'animatedGif', 'debug'); 61 animTest.beginTest(); 62 } 63 64 window.onload = main; 65 </script> 66 </pre> 67 </body> 68 </html>