test_webcam.html 2.2 KB

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