Bug 992685 - Part 3. Test video element resize event. r=roc
☠☠ backed out by 9b3e240d8b8e ☠ ☠
authorAndreas Pehrson <pehrsons@gmail.com>
Mon, 19 Jan 2015 23:46:00 +0100
changeset 224694 8aeda1b1d2e4345e1dfe75ff0b67a42217702970
parent 224693 c4d8cf5b47efefd3a0ab2db2b02f98bbf078dfdf
child 224695 deadc5352365f92c94da9beb91259edbd634f692
push id28143
push userryanvm@gmail.com
push dateWed, 21 Jan 2015 03:14:12 +0000
treeherdermozilla-central@540077a30866 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs992685
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 992685 - Part 3. Test video element resize event. r=roc
dom/media/test/test_video_dimensions.html
--- a/dom/media/test/test_video_dimensions.html
+++ b/dom/media/test/test_video_dimensions.html
@@ -19,37 +19,57 @@ var startTest = function(test, token) {
 
   // Avoid a race for hardware resources between v1 and v2 on platforms with
   // a hardware decoder, like B2G.
   v1.preload = 'none';
   v2.preload = 'none';
 
   var numVideoElementsFinished = 0;
 
+  var ondurationchange = function(ev) {
+    var v = ev.target;
+    info(v.testName + " got durationchange");
+    v.durationchange = true;
+  };
+  var onresize = function(ev) {
+    var v = ev.target;
+    info(v.testName + " got resize");
+    ok(!v.resize, v.testName + " should only fire resize once for same size");
+    v.resize = true;
+    ok(v.durationchange, v.testName +
+       " durationchange event should have been emitted before resize");
+    is(v.videoWidth, test.width, v.testName + " width should be set on resize");
+    is(v.videoHeight, test.height, v.testName + " height should be set on resize");
+  };
   var onloadedmetadata = function(ev) {
     var v = ev.target;
+    info(v.testName + " got loadedmetadata");
     ok(!v.loadedmetadata, v.testName + " should only fire loadedmetadata once");
     v.loadedmetadata = true;
-    is(v.videoWidth, test.width, v.testName + " video width should be set on loadedmetadata");
-    is(v.videoHeight, test.height, v.testName + " video height should be set on loadedmetadata");
+    ok(v.resize, v.testName +
+       " resize event should have been emitted before loadedmetadata");
 
     numVideoElementsFinished += 1;
     if (v === v1) {
       removeNodeAndSource(v1);
       v2.play();
       vout.play();
     }
 
     if (numVideoElementsFinished === 3) {
       removeNodeAndSource(v2);
       removeNodeAndSource(vout);
       manager.finished(token);
     }
   };
   var setupElement = function(v, id) {
+    v.durationchange = false;
+    v.ondurationchange = ondurationchange;
+    v.resize = false;
+    v.onresize = onresize;
     v.loadedmetadata = false;
     v.onloadedmetadata = onloadedmetadata;
     document.body.appendChild(v);
   };
 
   v1.testName = test.name;
   v2.testName = test.name + " (Captured)";
   vout.testName = test.name + " (Stream)";