Skip to content

Commit

Permalink
Bug 867774 - Tests for animated images with different disposal and bl…
Browse files Browse the repository at this point in the history
…end modes. r=seth
  • Loading branch information
joedrew committed Jun 18, 2013
1 parent f182e74 commit c489fa2
Show file tree
Hide file tree
Showing 14 changed files with 101 additions and 0 deletions.
Binary file added image/test/reftest/animated/clear.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/test/reftest/animated/clear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions image/test/reftest/animated/delaytest.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!DOCTYPE HTML>
<html class="reftest-wait">
<head>
<title>Delayed image reftest wrapper + background colour</title>
<style>
img {
background-color: rgb(0, 255, 0);
}
</style>
</head>
<body>
<img id="image1">
<script>
// This loads a externally specified image, forces a draw (in case of
// decode-on-draw), waits, 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 = 1000;
setTimeout("document.documentElement.className = '';", delay);
}
</script>
</body>
</html>
Binary file added image/test/reftest/animated/green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/test/reftest/animated/grey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/test/reftest/animated/keep.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/test/reftest/animated/keep.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions image/test/reftest/animated/nodelaytest.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<html class="reftest-wait">
<head>
<title>Delayed image reftest wrapper + background colour</title>
<style>
img {
background-color: rgb(0, 255, 0);
}
</style>
</head>
<body>
<img id="image1">
<script>
// This loads a externally specified image, forces a draw (in case of
// decode-on-draw), and then triggers the reftest snapshot.
//
// Use as "nodelaytest.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. trigger the reftest
setTimeout("document.documentElement.className = '';", 0);
}
</script>
</body>
</html>
Binary file added image/test/reftest/animated/over.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions image/test/reftest/animated/reftest.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Tests of the allowed disposal operators for both GIF and APNG: keep, clear,
# and restore previous.
== delaytest.html?clear.gif nodelaytest.html?green.png
== delaytest.html?clear.png nodelaytest.html?green.png
== delaytest.html?keep.gif nodelaytest.html?green.png
== delaytest.html?keep.png nodelaytest.html?green.png
== delaytest.html?restore-previous.gif nodelaytest.html?green.png
== delaytest.html?restore-previous.png nodelaytest.html?green.png

# Test of the blending/compositing operator that only APNG supports.
== delaytest.html?over.png nodelaytest.html?grey.png
!= delaytest.html?source.png nodelaytest.html?grey.png
Binary file added image/test/reftest/animated/restore-previous.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/test/reftest/animated/restore-previous.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/test/reftest/animated/source.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions image/test/reftest/reftest.list
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ skip-if(Android||B2G) include encoders-lossless/reftest.list # bug 783621

# WBMP tests
#skip-if(!B2G) include wbmp/reftest.list # bug 852053

# Animated image disposal and blending operator tests
include animated/reftest.list

0 comments on commit c489fa2

Please sign in to comment.