Bug 1370177 - Add test case for gzipped MP4 with Content-Length set to compressed file length. r=jwwang, a=jcristau
authorChris Pearce <cpearce@mozilla.com>
Tue, 04 Jul 2017 23:37:14 +1200
changeset 414285 6d8a8aac97680d0825da6487fe4a3820f3d94288
parent 414284 49c08ff2942bb6120f1f3ba8b6860c13981867e8
child 414286 f5dcff3ee593e869a87a57c4e1cc426c9a7f5459
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang, jcristau
bugs1370177
milestone55.0
Bug 1370177 - Add test case for gzipped MP4 with Content-Length set to compressed file length. r=jwwang, a=jcristau Adds a testcase corresponding to what's happening here; we have a gzipped file with a Content-Length which is the length of the compressed stream. MozReview-Commit-ID: 8SDayegP11W
dom/media/test/gzipped_mp4.sjs
dom/media/test/mochitest.ini
dom/media/test/short.mp4.gz
dom/media/test/test_video_gzip_encoding.html
new file mode 100644
--- /dev/null
+++ b/dom/media/test/gzipped_mp4.sjs
@@ -0,0 +1,29 @@
+const { classes: Cc, interfaces: Ci } = Components;
+
+function getGzippedFileBytes()
+{
+  var file;
+  getObjectState("SERVER_ROOT", function(serverRoot) {
+    file = serverRoot.getFile("tests/dom/media/test/short.mp4.gz");
+  });
+  var fileInputStream =
+    Components.classes['@mozilla.org/network/file-input-stream;1']
+              .createInstance(Components.interfaces.nsIFileInputStream);
+  var binaryInputStream =
+    Components.classes["@mozilla.org/binaryinputstream;1"]
+              .createInstance(Components.interfaces.nsIBinaryInputStream);
+  fileInputStream.init(file, -1, -1, 0);
+  binaryInputStream.setInputStream(fileInputStream);
+  return binaryInputStream.readBytes(binaryInputStream.available());
+}
+
+function handleRequest(request, response)
+{
+  var bytes = getGzippedFileBytes();
+  response.setHeader("Content-Length", String(bytes.length), false);
+  response.setHeader("Content-Type", "video/mp4", false);
+  response.setHeader("Access-Control-Allow-Origin", "*", false);
+  response.setHeader("Content-Encoding", "gzip", false);
+  response.setHeader("Cache-Control", "no-cache", false);
+  response.write(bytes, bytes.length);
+}
--- a/dom/media/test/mochitest.ini
+++ b/dom/media/test/mochitest.ini
@@ -438,16 +438,17 @@ support-files =
   gizmo-noaudio.mp4
   gizmo-noaudio.mp4^headers^
   gizmo-short.mp4
   gizmo-short.mp4^headers^
   gizmo.webm
   gizmo.webm^headers^
   gizmo-noaudio.webm
   gizmo-noaudio.webm^headers^
+  gzipped_mp4.sjs
   huge-id3.mp3
   huge-id3.mp3^headers^
   id3tags.mp3
   id3tags.mp3^headers^
   invalid-cmap-s0c0.opus
   invalid-cmap-s0c0.opus^headers^
   invalid-cmap-s0c2.opus
   invalid-cmap-s0c2.opus^headers^
@@ -546,16 +547,17 @@ support-files =
   short-cenc.mp4
   sine.webm
   sine.webm^headers^
   sintel-short-clearkey-subsample-encrypted-audio.webm
   sintel-short-clearkey-subsample-encrypted-audio.webm^headers^
   sintel-short-clearkey-subsample-encrypted-video.webm
   sintel-short-clearkey-subsample-encrypted-video.webm^headers^
   short.mp4
+  short.mp4.gz
   short.mp4^headers^
   short-aac-encrypted-audio.mp4
   short-aac-encrypted-audio.mp4^headers^
   short-audio-fragmented-cenc-without-pssh.mp4
   short-audio-fragmented-cenc-without-pssh.mp4^headers^
   short-video.ogv
   short-video.ogv^headers^
   short-vp9-encrypted-video.mp4
@@ -1178,8 +1180,10 @@ tags = suspend
 skip-if = toolkit == 'android' # bug 1346705
 tags = suspend
 [test_background_video_ended_event.html]
 skip-if = toolkit == 'android' # bug 1346705
 tags = suspend
 
 [test_temporary_file_blob_video_plays.html]
 skip-if = toolkit == 'android' # android(bug 1232305)
+
+[test_video_gzip_encoding.html]
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..efb95e38e30f261229e2eb13b359e60276311c02
GIT binary patch
literal 6708
zc$@(=8q4J$iwFqONU2x=19NC^a&#_ja5MnzTM0OnUHgB=UI@vW7+FG$8T-B@TNKI?
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3YfzPuj*4(t6pSW}4Jo|`3)
zfMv`kSQmeTH7AAeozedW(jMO+?fL_x?Fb|#<iEI02XOu|RFD+06wC&Q=)=Ooc7u%!
zV7^0-XG3Q#jg}a}8oKSAOkf6~#TmK@qqOplzi>oH3#Z;D{4fCD<K~YtEirDYr(uBU
z8}If5uE4QC!2TfAzc>F8gUmW$RFlCO(A{te;5`Tcg5bOh7XrZU7yyt2F$kc%F;rSe
z9SB(JAE6c9JkKCD$Vd_izj?0ZaKD2|qLfOcb+`+I+)&<_6LX}Gi?T8dp#Vd`75)dk
KW;wo7H2?tfB4k7W
new file mode 100644
--- /dev/null
+++ b/dom/media/test/test_video_gzip_encoding.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<html>
+  <head>
+    <title>Bug 1370177 gzipped mp4 with Content-Length</title>
+    <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+    <script type="text/javascript" src="manifest.js"></script>
+  </head>
+  <body>
+    <!--
+      Tests that an MP4 file served over a "Content-Encoding: gzip"
+      HTTP channel with a "Content-Length" header set to the length
+      of the compressed file works.
+    -->
+    <video id='v' src="http://mochi.test:8888/tests/dom/media/test/gzipped_mp4.sjs" controls autoplay></video>
+    <script>
+      SimpleTest.waitForExplicitFinish();
+      var v = document.getElementById('v');
+      v.addEventListener("ended", ()=>{
+        SimpleTest.finish();
+        mediaTestCleanup();
+      });
+    </script>
+  </body>
+</html>