Bug 1261964 part 2: Add reftest for downscaling a moz-icon image. r=seth
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 27 May 2016 14:03:35 -0700
changeset 338399 2e2085781ab223642bb266ff729a7569fdaf1858
parent 338398 e079016796cc75f450cdfddf4409c4a69bdfd710
child 338400 3b02a890b94e4b1879f0bd8e2361444e17de5dc5
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersseth
bugs1261964
milestone49.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 1261964 part 2: Add reftest for downscaling a moz-icon image. r=seth MozReview-Commit-ID: 61m5k5mYSWN
image/test/reftest/downscaling/downscale-moz-icon-1-ref.html
image/test/reftest/downscaling/downscale-moz-icon-1.html
image/test/reftest/downscaling/reftest.list
new file mode 100644
--- /dev/null
+++ b/image/test/reftest/downscaling/downscale-moz-icon-1-ref.html
@@ -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>
new file mode 100644
--- /dev/null
+++ b/image/test/reftest/downscaling/downscale-moz-icon-1.html
@@ -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>
--- a/image/test/reftest/downscaling/reftest.list
+++ b/image/test/reftest/downscaling/reftest.list
@@ -82,16 +82,18 @@ fuzzy(20,999) != downscale-2d.html?203,5
 fuzzy(20,999) != downscale-2e.html?203,52,bottom about:blank
 
 fuzzy(20,999) != downscale-2a.html?205,53,bottom about:blank
 fuzzy(20,999) != downscale-2b.html?205,53,bottom about:blank
 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
 
 # Non-transparent and transparent ICO images
 == downscale-16px.html?ff-0RGB.ico downscale-16px.html?ff-0RGB.png
 fuzzy(1,1) == downscale-16px.html?ff-ARGB.ico downscale-16px.html?ff-ARGB.png
 
 # Upside-down (negative height) BMP
@@ -163,16 +165,18 @@ fuzzy(20,999) != downscale-2f.html?203,5
 
 fuzzy(20,999) != downscale-2a.html?205,53,bottom about:blank
 fuzzy(20,999) != downscale-2b.html?205,53,bottom about:blank
 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) != 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
 
 # Non-transparent and transparent ICO images
 fuzzy(1,3) == downscale-16px.html?ff-0RGB.ico downscale-16px.html?ff-0RGB.png
 fuzzy(3,32) == downscale-16px.html?ff-ARGB.ico downscale-16px.html?ff-ARGB.png
 
 # Upside-down (negative height) BMP