Bug 1213938. Fix test to avoid triggering before any video frames are available. r=jya
authorRobert O'Callahan <robert@ocallahan.org>
Mon, 19 Oct 2015 22:11:55 +1300
changeset 303528 5f89883da0b4dc7388627a8479fa638a615076b9
parent 303527 fa2108dc17027f6298502c0b52d7ad2dcd8c7441
child 303529 2d0fadc97308f93872570c269d578a11157c0835
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1213938
milestone44.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 1213938. Fix test to avoid triggering before any video frames are available. r=jya
layout/reftests/ogg-video/444-1-ref.html
layout/reftests/ogg-video/444-1.html
--- a/layout/reftests/ogg-video/444-1-ref.html
+++ b/layout/reftests/ogg-video/444-1-ref.html
@@ -1,15 +1,20 @@
 <!DOCTYPE HTML>
 <html class="reftest-wait">
 <body>
-<video id="v1" src="seek420.ogv" style="position:absolute; left:0; top:0"></video>
+<video id="v1" style="position:absolute; left:0; top:0"></video>
 <!-- hide bottom of video -->
 <div style="position:absolute; top:120px; left:0; right:0; bottom:0; background:black"></div>
 <script>
 function doTest() {
+  // Set source now so that the loadeddata event can't fire before
+  // this function runs.
+  v1.src = "seek420.ogv";
   v1.play();
-  setTimeout(function() {
-    document.documentElement.removeAttribute('class');
-  }, 500);
+  v1.addEventListener("loadeddata", function() {
+    setTimeout(function() {
+      document.documentElement.removeAttribute('class');
+    }, 50);
+  });
 }
 document.addEventListener("MozReftestInvalidate", doTest, false);
 </script>
--- a/layout/reftests/ogg-video/444-1.html
+++ b/layout/reftests/ogg-video/444-1.html
@@ -1,15 +1,20 @@
 <!DOCTYPE HTML>
 <html class="reftest-wait">
 <body>
-<video id="v1" src="seek444.ogv" style="position:absolute; left:0; top:0"></video>
+<video id="v1" style="position:absolute; left:0; top:0"></video>
 <!-- hide bottom of video -->
 <div style="position:absolute; top:120px; left:0; right:0; bottom:0; background:black"></div>
 <script>
 function doTest() {
+  // Set source now so that the loadeddata event can't fire before
+  // this function runs.
+  v1.src = "seek444.ogv";
   v1.play();
-  setTimeout(function() {
-    document.documentElement.removeAttribute('class');
-  }, 500);
+  v1.addEventListener("loadeddata", function() {
+    setTimeout(function() {
+      document.documentElement.removeAttribute('class');
+    }, 50);
+  });
 }
 document.addEventListener("MozReftestInvalidate", doTest, false);
 </script>