Bug 1232045 - Add tests for WebM with resolution changes. r=jya
authorBryce Van Dyk <bvandyk@mozilla.com>
Mon, 14 Mar 2016 15:13:51 +1300
changeset 290547 3d31cc25fd3b28b928a7f4b90f481fb66976363f
parent 290546 7a8fb7e6f6f915ad87eba700b4f36ff0c0d5ecab
child 290548 1fc001760e73deabb9c2114bd88876be3699a0b8
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1232045
milestone48.0a1
Bug 1232045 - Add tests for WebM with resolution changes. r=jya Added a test WebM file containing resolution changes. This file has been added to gPlayTests to test playback of such files. A new test has been added, test_resolution_change.html, which reads a new test array, gResolutionChangeTests, of media files containing resolution changes. This new test check that after playing a file through at least one resolution change has taken place. MozReview-Commit-ID: 8yz1ccz8g6O
dom/media/test/manifest.js
dom/media/test/mochitest.ini
dom/media/test/resolution-change.webm
dom/media/test/resolution-change.webm^headers^
dom/media/test/test_resolution_change.html
--- a/dom/media/test/manifest.js
+++ b/dom/media/test/manifest.js
@@ -215,16 +215,19 @@ var gPlayTests = [
     type:"video/ogg", duration:0.266 },
 
   // Test playback of a webm file
   { name:"seek.webm", type:"video/webm", duration:3.966 },
 
   // Test playback of a WebM file with non-zero start time.
   { name:"split.webm", type:"video/webm", duration:1.967 },
 
+  // Test playback of a WebM file with resolution changes.
+  { name:"resolution-change.webm", type:"video/webm", duration:6.533 },
+
   // Test playback of a raw file
   { name:"seek.yuv", type:"video/x-raw-yuv", duration:1.833 },
 
   // A really short, low sample rate, single channel file. This tests whether
   // we can handle playing files when only push very little audio data to the
   // hardware.
   { name:"spacestorm-1000Hz-100ms.ogg", type:"audio/ogg", duration:0.099 },
 
@@ -279,16 +282,21 @@ var gSnifferTests = [
   { name:"320x240.ogv", type:"video/ogg", width:320, height:240, duration:0.233, size:28942 },
   { name:"seek.webm", type:"video/webm", duration:3.966, size:215529 },
   { name:"gizmo.mp4", type:"video/mp4", duration:5.56, size:383631 },
   // A mp3 file with id3 tags.
   { name:"id3tags.mp3", type:"audio/mpeg", duration:0.28, size:3530},
   { name:"bogus.duh", type:"bogus/duh" }
 ];
 
+// Files that contain resolution changes
+var gResolutionChangeTests = [
+  { name:"resolution-change.webm", type:"video/webm", duration:6.533 },
+];
+
 // Files we must reject as invalid.
 var gInvalidTests = [
   { name:"invalid-m0c0.opus", type:"audio/ogg; codecs=opus"},
   { name:"invalid-m0c3.opus", type:"audio/ogg; codecs=opus"},
   { name:"invalid-m1c0.opus", type:"audio/ogg; codecs=opus"},
   { name:"invalid-m1c9.opus", type:"audio/ogg; codecs=opus"},
   { name:"invalid-m2c0.opus", type:"audio/ogg; codecs=opus"},
   { name:"invalid-m2c1.opus", type:"audio/ogg; codecs=opus"},
--- a/dom/media/test/mochitest.ini
+++ b/dom/media/test/mochitest.ini
@@ -470,16 +470,18 @@ support-files =
   r11025_u8_c1_trunc.wav
   r11025_u8_c1_trunc.wav^headers^
   r16000_u8_c1_list.wav
   r16000_u8_c1_list.wav^headers^
   reactivate_helper.html
   redirect.sjs
   referer.sjs
   region.vtt
+  resolution-change.webm
+  resolution-change.webm^headers^
   sample.3gp
   sample.3g2
   sample-fisbone-skeleton4.ogv
   sample-fisbone-skeleton4.ogv^headers^
   sample-fisbone-wrong-header.ogv
   sample-fisbone-wrong-header.ogv^headers^
   seek.ogv
   seek.ogv^headers^
@@ -767,16 +769,17 @@ skip-if = toolkit == 'gonk' # bug 112884
 [test_reactivate.html]
 skip-if = toolkit == 'gonk' # bug 1128845 on gonk
 [test_readyState.html]
 [test_referer.html]
 [test_replay_metadata.html]
 [test_reset_events_async.html]
 [test_reset_src.html]
 [test_video_dimensions.html]
+[test_resolution_change.html]
 tags=capturestream
 [test_resume.html]
 skip-if = true # bug 1021673
 [test_seek_negative.html]
 [test_seek_nosrc.html]
 [test_seek_out_of_range.html]
 [test_seek-1.html]
 [test_seek-2.html]
new file m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br<&CxPE_9WXI#*++0MHR8g{-Oyo
NyUilUW)s9u{|9kbM8p69
new file mode 100644
--- /dev/null
+++ b/dom/media/test/resolution-change.webm^headers^
@@ -0,0 +1,1 @@
+Cache-Control: no-store
new file mode 100644
--- /dev/null
+++ b/dom/media/test/test_resolution_change.html
@@ -0,0 +1,52 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>Test playback of files with resolution changes</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>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+
+var manager = new MediaTestManager;
+
+function loadedData(e) {
+  var v = e.target;
+  v.addEventListener("resize", resize, false);
+  v.play();
+}
+
+function resize(e) {
+  var v = e.target;
+  v.seenResolutionChange = true;
+}
+
+function ended(e)  {
+  var v = e.target;
+  ok(v.seenResolutionChange, v.token + ": A resolution change should have ocurred by the end of playback");
+  removeNodeAndSource(v);
+  manager.finished(v.token);
+}
+
+function startTest(test, token) {
+  var v = document.createElement('video');
+  v.preload = "metadata";
+  v.token = token;
+  v.src = test.name;
+  v.seenResolutionChange = false;
+
+  v.addEventListener("loadeddata", loadedData, false)
+  v.addEventListener("ended", ended, false);
+
+  manager.started(token);
+  document.body.appendChild(v);
+}
+
+manager.runTests(gResolutionChangeTests, startTest);
+
+</script>
+</pre>
+</body>
+</html>