Bug 1261964 part 2: Add reftest for downscaling a moz-icon image. r=seth

MozReview-Commit-ID: 61m5k5mYSWN
This commit is contained in:
Daniel Holbert 2016-05-27 14:03:35 -07:00
parent a9f89f1558
commit 53e62d6130
3 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,37 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html class="reftest-wait">
<head>
<meta charset="utf-8" />
<title>Reference for downscaling moz-icon images (bug 1261964)</title>
<script>
function beginTest() {
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
var image = new Image();
image.onload = function() {
// When image loads: draw it to canvas, scale down the canvas, and
// then let the reftest snapshot happen.
ctx.drawImage(image, 0, 0);
canvas.setAttribute("class", "downscale");
document.documentElement.removeAttribute("class");
}
// Kick off the image load:
image.src = "moz-icon://bogus-unrecognized-icon?size=100";
}
</script>
<style>
body { margin: 0; }
.downscale {
transform-origin: 0 0;
transform: scale(0.9);
}
</style>
</head>
<body onload="beginTest()">
<canvas id="canvas" height="100px" width="100px"></canvas>
</body>
</html>

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html>
<head>
<meta charset="utf-8" />
<title>Testcase for downscaling moz-icon images (bug 1261964)</title>
<style>
body { margin: 0; }
.downscale {
transform-origin: 0 0;
transform: scale(0.9);
}
</style>
</head>
<body>
<img class="downscale" src="moz-icon://bogus-unrecognized-icon?size=100">
</body>
</html>

View File

@ -87,6 +87,8 @@ fuzzy(20,999) != downscale-2c.html?205,53,bottom about:blank
fuzzy(20,999) != downscale-2d.html?205,53,bottom about:blank
fuzzy(20,999) fails-if(OSX>=1008&&!skiaContent) != downscale-2e.html?205,53,bottom about:blank
fuzzy(28,3386) == downscale-moz-icon-1.html downscale-moz-icon-1-ref.html
== downscale-png.html?16,16,interlaced downscale-png.html?16,16,normal
== downscale-png.html?24,24,interlaced downscale-png.html?24,24,normal
@ -168,6 +170,8 @@ fuzzy(20,999) != downscale-2d.html?205,53,bottom about:blank
fuzzy(20,999) != downscale-2e.html?205,53,bottom about:blank
fuzzy(20,999) != downscale-2f.html?205,53,bottom about:blank
fuzzy(36,4439) == downscale-moz-icon-1.html downscale-moz-icon-1-ref.html
== downscale-png.html?16,16,interlaced downscale-png.html?16,16,normal
== downscale-png.html?24,24,interlaced downscale-png.html?24,24,normal