Create a test to ensure we properly handle animated images with frames that dispose by clearing. This would have caught some of the regressions with the Cairo update.
authorJoe Drew <joe@drew.ca>
Thu, 08 Apr 2010 16:10:48 -0400
changeset 40605 a0734d2d06265fb64fb0b4117fe3911e949a38ef
parent 40604 ed68058029e38e8a876785aa1ef6e1d62eda179f
child 40606 8d99566a95942e465e1b725939cb208113cf778b
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
Create a test to ensure we properly handle animated images with frames that dispose by clearing. This would have caught some of the regressions with the Cairo update.
modules/libpr0n/test/reftest/gif/delaytest.html
modules/libpr0n/test/reftest/gif/reftest.list
modules/libpr0n/test/reftest/gif/transparent-animation-finalframe.gif
modules/libpr0n/test/reftest/gif/transparent-animation.gif
new file mode 100644
--- /dev/null
+++ b/modules/libpr0n/test/reftest/gif/delaytest.html
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<head>
+<title>Delayed image reftest wrapper</title>
+</head>
+<body>
+<img id="image1">
+<script>
+// This loads a externally specified image, forces a draw (in case of
+// decode-on-draw), waits 100ms, and then triggers the reftest snapshot.
+// This allows the animation on the page to complete.
+//
+// Use as "delaytest.html?animation.png"
+//
+
+// Get the image URL from our URL
+var imgURL = document.location.search.substr(1);
+
+// Load the image
+var img = document.images[0];
+img.src = imgURL;
+img.onload = forceDecode;
+
+function forceDecode() {
+
+  // We need to force drawing of the image in an invisible context
+  var canvas = document.createElement("canvas");
+  var ctx = canvas.getContext("2d");
+  ctx.drawImage(img, 0, 0);
+
+  // We've force the decode. start the timer to trigger the reftest
+  startTimer();
+}
+
+function startTimer() {
+  const delay = 500;
+  setTimeout("document.documentElement.className = '';", delay);
+}
+</script>
+</body>
+</html>
--- a/modules/libpr0n/test/reftest/gif/reftest.list
+++ b/modules/libpr0n/test/reftest/gif/reftest.list
@@ -6,8 +6,12 @@
 == out-of-colormap-trans.gif out-of-colormap-trans.png
 
 # a GIF file that uses the comment extension
 == comment.gif comment.png
 
 # a GIF file with a background smaller than the size of the canvas
 == small-background-size.gif small-background-size-ref.gif
 == small-background-size-2.gif small-background-size-2-ref.gif
+
+# a transparent gif that disposes previous frames with clear; we must properly
+# clear each frame to pass.
+== delaytest.html?transparent-animation.gif transparent-animation-finalframe.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a55f92a813ae107725ea5ea9781ed8574529dce3
GIT binary patch
literal 121
zc$@)w0EYiZNk%w1VPpVg0Du7i{{R60|NkNR1OWj60RSuj0000R0Av6F0#J;PsmtvT
zqnxzbi?iOm`wxcVNS5Y_rs~SJ?gYg0OxN~}=lag~{tpZahs2`sh)gP%%%<}RjY_A~
bs`ZM^YPa03_iKHL$K<m4j83c9s{#N!L1R1k
new file mode 100644
index 0000000000000000000000000000000000000000..b2895487bd5df3407a207bd50acd668fff0fd032
GIT binary patch
literal 527
zc${<hbhEHbOkqf2XkcXc&%p5i|9{1wES!uCj0`#qK;R9OVPM+R)4%fcTmHp!w%qF8
zd~eTh{<cRR)1GxMdv$8tJMQD3e6D}%eg5m*_ka96T<u2|eeCejny%RJnX}hxdB}^E
zU1yWl-&!~QHE;OAN1Lvu_}QP#GTi;w_3-KUmD}><Pk)ZJiGTIIJWOeYXaq+=#0rfQ
zKc1gppQ)bdZkf*6eskH%V>6#+vUzQ9w@`iM79~|Gbxg{AMb<2-*H3PlduL~NNUyFw
zzWUW}))=id$6MyC*>mR3n?F3Vy0*TtxwXA>bAuQdP&{M;_Rt0*J@lS|1MDFcr%7kj
zieL74ExeR9DeJ73{H=EaueUZG4%V}@wllx{YV}Up)Wf}>ewt;(@Be(l>i&H840Q{4
zj`SOCE0$Fp^LQq~_EPnx>&n#5ZO7f0@2tH3;O2Ent_DprsjR4_QEl$OPJW0wBGvxN
z^L5MW=UUNRU$|v-Y<yyJYI?vP`V)ZW32Cq=0`Pc(<p|bTIkOBLD_2&1?K+#a{m#1Y
U*|nX=pKSWs<G1?yY9<D20B+X@R{#J2