Bug 1261964 part 2: Add reftest for downscaling a moz-icon image. r=seth, a=test-only
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 27 May 2016 14:03:35 -0700
changeset 333142 70f81ba71a72ba4f901d6685e98bc12598fcb96e
parent 333141 3ff74bec4cc8e09bcc0b20c1a9a60a875336ff4a
child 333143 3c098dac67aa4bf840dba48d75be86bc8cc74417
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersseth, test-only
bugs1261964
milestone48.0a2
Bug 1261964 part 2: Add reftest for downscaling a moz-icon image. r=seth, a=test-only 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