Bug 729784 - Fix documentation for fuzzy() and fuzzy-if(), and give image difference error messages in the same order as the parameters to them. r=dbaron
authorMatt Woodrow <mwoodrow@mozilla.com>
Sat, 28 Jul 2012 13:47:46 +1200
changeset 100803 8253f91b0eef44dc892eb61ae8c1e69caa927f64
parent 100802 6718d4c7b6c1e0ada1f1e5996d8022f59b05807a
child 100804 db790a34ba9a2a5e6a0fd7473e7a5e42d6f2611c
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersdbaron
bugs729784
milestone17.0a1
Bug 729784 - Fix documentation for fuzzy() and fuzzy-if(), and give image difference error messages in the same order as the parameters to them. r=dbaron
layout/tools/reftest/README.txt
layout/tools/reftest/reftest.js
--- a/layout/tools/reftest/README.txt
+++ b/layout/tools/reftest/README.txt
@@ -101,23 +101,26 @@ 2. A test item
 
       slow-if(condition) If the condition is met, the test is treated as if
                          'slow' had been specified.  This is useful for tests
                          which are slow only on particular platforms (e.g. a
                          test which exercised out-of-memory behavior might be
                          fast on a 32-bit system but inordinately slow on a
                          64-bit system).
 
-      fuzzy  This allows a test to pass if the pixel value differences
-             are <= 2. It can also be used with '!=' to ensure that the
-             difference is greater than 2.
+      fuzzy(maxDiff, diffCount)
+          This allows a test to pass if the pixel value differences are <=
+          maxDiff and the total number of different pixels is <= diffCount.
+          It can also be used with '!=' to ensure that the difference is
+          greater than maxDiff.
 
-      fuzzy-if(condition) If the condition is met, the test is treated as if
-                          'fuzzy' had been specified. This is useful if there
-                          are differences on particular platforms.
+      fuzzy-if(condition, maxDiff, diffCount)
+          If the condition is met, the test is treated as if 'fuzzy' had been
+          specified. This is useful if there are differences on particular
+          platforms.
 
       require-or(cond1&&cond2&&...,fallback)
           Require some particular setup be performed or environmental
           condition(s) made true (eg setting debug mode) before the test
           is run. If any condition is unknown, unimplemented, or fails,
           revert to the fallback failure-type.
           Example: require-or(debugMode,skip)
 
--- a/layout/tools/reftest/reftest.js
+++ b/layout/tools/reftest/reftest.js
@@ -1451,17 +1451,17 @@ function RecordResult(testRunTime, error
             gDumpLog(result + "\n");
 
             if (!test_passed && expected == EXPECTED_PASS ||
                 !test_passed && expected == EXPECTED_FUZZY ||
                 test_passed && expected == EXPECTED_FAIL) {
                 if (!equal) {
                     gDumpLog("REFTEST   IMAGE 1 (TEST): " + gCanvas1.toDataURL() + "\n");
                     gDumpLog("REFTEST   IMAGE 2 (REFERENCE): " + gCanvas2.toDataURL() + "\n");
-                    gDumpLog("REFTEST number of differing pixels: " + differences + " max difference: " + maxDifference.value + "\n");
+                    gDumpLog("REFTEST max difference: " + maxDifference.value + " number of differing pixels: " + differences + "\n");
                 } else {
                     gDumpLog("REFTEST   IMAGE: " + gCanvas1.toDataURL() + "\n");
                 }
             }
 
             if (!test_passed && expected == EXPECTED_PASS) {
                 FlushTestLog();
             }