Bug 718329 - Make fuzzy reftests take max tolerance values. r=roc

This commit is contained in:
Matt Woodrow 2012-01-23 20:56:12 +13:00
parent 312b83a0ae
commit c869eebf05
4 changed files with 59 additions and 40 deletions

View File

@ -1688,4 +1688,4 @@ needs-focus != 703186-1.html 703186-2.html
== 714519-1-q.html 714519-1-ref.html
== 714519-2-as.html 714519-2-ref.html
== 714519-2-q.html 714519-2-ref.html
fuzzy == 718521.html 718521-ref.html
fuzzy-if(cocoaWidget,1,170) == 718521.html 718521-ref.html

View File

@ -1,9 +1,9 @@
fuzzy-if(azureQuartz) fails-if(Android) == linear-1a.html linear-1-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == linear-1b.html linear-1-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == linear-keywords-1a.html linear-keywords-1-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == linear-keywords-1b.html linear-keywords-1-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == linear-percent.html linear-percent-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == linear-mix.html linear-mix-ref.html
fuzzy-if(azureQuartz,1,34919) fails-if(Android) == linear-1a.html linear-1-ref.html
fuzzy-if(azureQuartz,1,34919) fails-if(Android) == linear-1b.html linear-1-ref.html
fuzzy-if(azureQuartz,1,11483) fails-if(Android) == linear-keywords-1a.html linear-keywords-1-ref.html
fuzzy-if(azureQuartz,1,11483) fails-if(Android) == linear-keywords-1b.html linear-keywords-1-ref.html
fuzzy-if(azureQuartz,1,10230) fails-if(Android) == linear-percent.html linear-percent-ref.html
fuzzy-if(azureQuartz,1,17068) fails-if(Android) == linear-mix.html linear-mix-ref.html
== linear-diagonal-1a.html linear-diagonal-1-ref.html
== linear-diagonal-1b.html linear-diagonal-1-ref.html
== linear-diagonal-1c.html linear-diagonal-1-ref.html
@ -36,20 +36,20 @@ fails-if(d2d) == linear-repeat-1g.html linear-repeat-1-ref.html # bug 582236
== linear-stops-1d.html linear-stops-1-ref.html
== linear-stops-1e.html linear-stops-1-ref.html
== linear-stops-1f.html linear-stops-1-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == linear-vertical-1a.html linear-vertical-1-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == linear-vertical-1b.html linear-vertical-1-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == linear-vertical-1c.html linear-vertical-1-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == linear-vertical-1d.html linear-vertical-1-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == linear-vertical-1e.html linear-vertical-1-ref.html
fuzzy-if(azureQuartz,1,9674) fails-if(Android) == linear-vertical-1a.html linear-vertical-1-ref.html
fuzzy-if(azureQuartz,1,9674) fails-if(Android) == linear-vertical-1b.html linear-vertical-1-ref.html
fuzzy-if(azureQuartz,1,9674) fails-if(Android) == linear-vertical-1c.html linear-vertical-1-ref.html
fuzzy-if(azureQuartz,1,9674) fails-if(Android) == linear-vertical-1d.html linear-vertical-1-ref.html
fuzzy-if(azureQuartz,1,9674) fails-if(Android) == linear-vertical-1e.html linear-vertical-1-ref.html
== linear-viewport.html linear-viewport-ref.html
== linear-zero-length-1a.html linear-zero-length-1-ref.html
== linear-zero-length-1b.html linear-zero-length-1-ref.html
== linear-zero-length-1c.html linear-zero-length-1-ref.html
== nostops.html about:blank
== onestop.html about:blank
fuzzy-if(azureQuartz) fails-if(Android) random-if(d2d) == radial-1a.html radial-1-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == radial-2a.html radial-2-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == radial-2b.html radial-2-ref.html
fuzzy-if(azureQuartz,1,1997) fails-if(Android) random-if(d2d) == radial-1a.html radial-1-ref.html
fuzzy-if(azureQuartz,1,1926) fails-if(Android) == radial-2a.html radial-2-ref.html
fuzzy-if(azureQuartz,1,1926) fails-if(Android) == radial-2b.html radial-2-ref.html
== radial-position-1a.html radial-position-1-ref.html
== radial-shape-closest-corner-1a.html radial-shape-closest-corner-1-ref.html
== radial-shape-closest-side-1a.html radial-shape-closest-side-1-ref.html
@ -77,23 +77,23 @@ fails-if(/Mac\x20OS\x20X\x2010\.[56]/.test(http.oscpu)) == twostops-1c.html twos
== twostops-1g.html twostops-1-ref.html
# from http://www.xanthir.com/:4bhipd by way of http://a-ja.net/newgrad.html
fuzzy-if(azureQuartz) fails-if(Android) == aja-linear-1a.html aja-linear-1-ref.html
fuzzy-if(azureQuartz,1,4646) fails-if(Android) == aja-linear-1a.html aja-linear-1-ref.html
fails-if(!d2d) == aja-linear-1b.html aja-linear-1-ref.html # bug 526694
fuzzy-if(azureQuartz) fails-if(Android) == aja-linear-1c.html aja-linear-1-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == aja-linear-1d.html aja-linear-1-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == aja-linear-1e.html aja-linear-1-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == aja-linear-1f.html aja-linear-1-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == aja-linear-1g.html aja-linear-1-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == aja-linear-2a.html aja-linear-2-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == aja-linear-2b.html aja-linear-2-ref.html
fuzzy-if(azureQuartz,1,4646) fails-if(Android) == aja-linear-1c.html aja-linear-1-ref.html
fuzzy-if(azureQuartz,1,4646) fails-if(Android) == aja-linear-1d.html aja-linear-1-ref.html
fuzzy-if(azureQuartz,1,4646) fails-if(Android) == aja-linear-1e.html aja-linear-1-ref.html
fuzzy-if(azureQuartz,1,4646) fails-if(Android) == aja-linear-1f.html aja-linear-1-ref.html
fuzzy-if(azureQuartz,1,4646) fails-if(Android) == aja-linear-1g.html aja-linear-1-ref.html
fuzzy-if(azureQuartz,1,4675) fails-if(Android) == aja-linear-2a.html aja-linear-2-ref.html
fuzzy-if(azureQuartz,1,4675) fails-if(Android) == aja-linear-2b.html aja-linear-2-ref.html
fails == aja-linear-2c.html aja-linear-2-ref.html # bug 522607
fails-if(!d2d) == aja-linear-2d.html aja-linear-2-ref.html # bug 526694
fuzzy-if(azureQuartz) fails-if(Android) == aja-linear-3a.html aja-linear-3-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == aja-linear-3b.html aja-linear-3-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == aja-linear-4a.html aja-linear-4-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == aja-linear-4b.html aja-linear-4-ref.html
fuzzy-if(azureQuartz) fails-if(Android) == aja-linear-5a.html aja-linear-5-ref.html
fuzzy-if(azureQuartz) fails-if(Android) fails-if(/Mac\x20OS\x20X\x2010\.5/.test(http.oscpu)) == aja-linear-6a.html aja-linear-6-ref.html # bug 526708
fuzzy-if(azureQuartz,1,4900) fails-if(Android) == aja-linear-3a.html aja-linear-3-ref.html
fuzzy-if(azureQuartz,1,4900) fails-if(Android) == aja-linear-3b.html aja-linear-3-ref.html
fuzzy-if(azureQuartz,1,8655) fails-if(Android) == aja-linear-4a.html aja-linear-4-ref.html
fuzzy-if(azureQuartz,1,8655) fails-if(Android) == aja-linear-4b.html aja-linear-4-ref.html
fuzzy-if(azureQuartz,2,7878) fails-if(Android) == aja-linear-5a.html aja-linear-5-ref.html
fuzzy-if(azureQuartz,1,3910) fails-if(Android) fails-if(/Mac\x20OS\x20X\x2010\.5/.test(http.oscpu)) == aja-linear-6a.html aja-linear-6-ref.html # bug 526708
fails == aja-linear-6b.html aja-linear-6-ref.html # bug 522607
== height-dependence-1.html height-dependence-1-ref.html
fails-if(cocoaWidget) == height-dependence-2.html height-dependence-2-ref.html # bug 535007

View File

@ -129,10 +129,10 @@ pref(font.default.x-western,"sans-serif") == font-sans-serif.html font-default.h
pref(font.default.x-western,"sans-serif") != font-serif.html font-default.html
fails pref(font.default.x-western,true) == font-serif.html font-default.html
fails pref(font.default.x-western,0) == font-serif.html font-default.html
# reftest syntax: fuzzy
fuzzy == fuzzy.html fuzzy-ref.html
fuzzy != too-fuzzy.html fuzzy-ref.html
fuzzy-if(true) == fuzzy.html fuzzy-ref.html
fuzzy-if(false) == fuzzy-ref.html fuzzy-ref.html
# reftest syntax: fuzzy(maxPixelDifference,maxNumberDifferingPixels)
fuzzy(1,250000) == fuzzy.html fuzzy-ref.html
fuzzy(1,250000) != too-fuzzy.html fuzzy-ref.html
fuzzy-if(true,1,250000) == fuzzy.html fuzzy-ref.html
fuzzy-if(false,2,1) == fuzzy-ref.html fuzzy-ref.html
# When using 565 fuzzy.html and fuzzy-ref.html will compare as equal
fails fuzzy-if(false) random-if(Android) == fuzzy.html fuzzy-ref.html
fails fuzzy-if(false,2,1) random-if(Android) == fuzzy.html fuzzy-ref.html

View File

@ -688,17 +688,19 @@ function ReadManifest(aURL, inherited_status)
var needs_focus = false;
var slow = false;
var prefSettings = [];
var fuzzy_max_delta = 2;
var fuzzy_max_pixels = 1;
while (items[0].match(/^(fails|needs-focus|random|skip|asserts|slow|require-or|silentfail|pref|fuzzy)/)) {
var item = items.shift();
var stat;
var cond;
var m = item.match(/^(fails|random|skip|silentfail|fuzzy)-if(\(.*\))$/);
var m = item.match(/^(fails|random|skip|silentfail)-if(\(.*\))$/);
if (m) {
stat = m[1];
// Note: m[2] contains the parentheses, and we want them.
cond = Components.utils.evalInSandbox(m[2], sandbox);
} else if (item.match(/^(fails|random|skip|fuzzy)$/)) {
} else if (item.match(/^(fails|random|skip)$/)) {
stat = item;
cond = true;
} else if (item == "needs-focus") {
@ -769,6 +771,18 @@ function ReadManifest(aURL, inherited_status)
prefSettings.push( { name: prefName,
type: prefType,
value: prefVal } );
} else if ((m = item.match(/^fuzzy\((\d+),(\d+)\)$/))) {
cond = false;
expected_status = EXPECTED_FUZZY;
fuzzy_max_delta = Number(m[1]);
fuzzy_max_pixels = Number(m[2]);
} else if ((m = item.match(/^fuzzy-if\((.*?),(\d+),(\d+)\)$/))) {
cond = false;
if (Components.utils.evalInSandbox("(" + m[1] + ")", sandbox)) {
expected_status = EXPECTED_FUZZY;
fuzzy_max_delta = Number(m[2]);
fuzzy_max_pixels = Number(m[3]);
}
} else {
throw "Error 1 in manifest file " + aURL.spec + " line " + lineNo;
}
@ -780,8 +794,6 @@ function ReadManifest(aURL, inherited_status)
expected_status = EXPECTED_RANDOM;
} else if (stat == "skip") {
expected_status = EXPECTED_DEATH;
} else if (stat == "fuzzy") {
expected_status = EXPECTED_FUZZY;
} else if (stat == "silentfail") {
allow_silent_fail = true;
}
@ -850,6 +862,8 @@ function ReadManifest(aURL, inherited_status)
needsFocus: needs_focus,
slow: slow,
prefSettings: prefSettings,
fuzzyMaxDelta: fuzzy_max_delta,
fuzzyMaxPixels: fuzzy_max_pixels,
url1: testURI,
url2: null } );
} else if (items[0] == TYPE_SCRIPT) {
@ -873,6 +887,8 @@ function ReadManifest(aURL, inherited_status)
needsFocus: needs_focus,
slow: slow,
prefSettings: prefSettings,
fuzzyMaxDelta: fuzzy_max_delta,
fuzzyMaxPixels: fuzzy_max_pixels,
url1: testURI,
url2: null } );
} else if (items[0] == TYPE_REFTEST_EQUAL || items[0] == TYPE_REFTEST_NOTEQUAL) {
@ -899,6 +915,8 @@ function ReadManifest(aURL, inherited_status)
needsFocus: needs_focus,
slow: slow,
prefSettings: prefSettings,
fuzzyMaxDelta: fuzzy_max_delta,
fuzzyMaxPixels: fuzzy_max_pixels,
url1: testURI,
url2: refURI } );
} else {
@ -1413,7 +1431,8 @@ function RecordResult(testRunTime, errorMsg, scriptResults)
// what is expected on this platform (PASS, FAIL, or RANDOM)
var expected = gURLs[0].expected;
if (maxDifference.value > 0 && maxDifference.value <= 2) {
if (maxDifference.value > 0 && maxDifference.value <= gURLs[0].fuzzyMaxDelta &&
differences <= gURLs[0].fuzzyMaxPixels) {
if (equal) {
throw "Inconsistent result from compareCanvases.";
}