Bug 1401997 - Always report pixel difference counts for reftests. r=jmaher
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 21 Sep 2017 11:28:24 -0400
changeset 668483 2b87ee06ac0478e58c7a20be52b413f73ee630dc
parent 668482 87ffa54a5436b83fb090616af2849966c64144f3
child 668484 83afa692da84387ded48b42f36f05911a4cbadb0
push id81062
push usergszorc@mozilla.com
push dateThu, 21 Sep 2017 18:37:24 +0000
reviewersjmaher
bugs1401997
milestone58.0a1
Bug 1401997 - Always report pixel difference counts for reftests. r=jmaher MozReview-Commit-ID: 5f2JPMA1ntP
layout/tools/reftest/reftest.jsm
--- a/layout/tools/reftest/reftest.jsm
+++ b/layout/tools/reftest/reftest.jsm
@@ -1940,17 +1940,18 @@ function RecordResult(testRunTime, error
                     failures.push("failed reftest-opaque-layer: " + gFailedOpaqueLayerMessages.join(", "));
                 }
                 if (gFailedAssignedLayer) {
                     failures.push("failed reftest-assigned-layer: " + gFailedAssignedLayerMessages.join(", "));
                 }
                 var failureString = failures.join(", ");
                 logger.testEnd(gURLs[0].identifier, output.s[0], output.s[1], failureString, null, extra);
             } else {
-                var message = "image comparison";
+                var message = "image comparison, max difference: " + maxDifference.value +
+                              ", number of differing pixels: " + differences;
                 if (!test_passed && expected == EXPECTED_PASS ||
                     !test_passed && expected == EXPECTED_FUZZY ||
                     test_passed && expected == EXPECTED_FAIL) {
                     if (!equal) {
                         extra.max_difference = maxDifference.value;
                         extra.differences = differences;
                         var image1 = gCanvas1.toDataURL();
                         var image2 = gCanvas2.toDataURL();
@@ -1958,18 +1959,16 @@ function RecordResult(testRunTime, error
                             {url:gURLs[0].identifier[0],
                              screenshot: image1.slice(image1.indexOf(",") + 1)},
                             gURLs[0].identifier[1],
                             {url:gURLs[0].identifier[2],
                              screenshot: image2.slice(image2.indexOf(",") + 1)}
                         ];
                         extra.image1 = image1;
                         extra.image2 = image2;
-                        message += (", max difference: " + extra.max_difference +
-                                    ", number of differing pixels: " + differences);
                     } else {
                         var image1 = gCanvas1.toDataURL();
                         extra.reftest_screenshots = [
                             {url:gURLs[0].identifier[0],
                              screenshot: image1.slice(image1.indexOf(",") + 1)}
                         ];
                         extra.image1 = image1;
                     }