Bug 852850 - Follow-up to improve failure output with reftest-no-paint. r=dbaron

This commit is contained in:
Matt Woodrow 2013-06-07 17:10:31 +12:00
Родитель 8fb1bb7132
Коммит 72f2f3cb9f
5 изменённых файлов: 76 добавлений и 25 удалений

Просмотреть файл

@ -0,0 +1,7 @@
<!DOCTYPE HTML>
<html>
<body style="background-color: black">
<div style="background-color: rgba(255, 0, 0, 0.5); width:100px; height:100px;" >
</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,15 @@
<!DOCTYPE HTML>
<html class="reftest-wait">
<body>
<div class="reftest-no-paint" style="background-color: rgba(255, 0, 0, 0.5); width:100px; height:100px;" >
</div>
<script type="application/javascript">
function doTest() {
document.body.style.background = "black";
document.documentElement.removeAttribute("class");
}
document.addEventListener("MozReftestInvalidate", doTest, false);
</script>
</body>
</html>

Просмотреть файл

@ -155,3 +155,6 @@ 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,2,1) random-if(Android) == fuzzy.html fuzzy-ref.html
# Test that reftest-no-paint fails correctly
fails == reftest-no-paint.html reftest-no-paint-ref.html

Просмотреть файл

@ -444,7 +444,7 @@ function WaitForTestEnd(contentRootElement, inPrintMode, spellCheckedElements) {
var elements = getNoPaintElements(contentRootElement);
for (var i = 0; i < elements.length; ++i) {
if (windowUtils().checkAndClearPaintedState(elements[i])) {
LogError("REFTEST TEST-UNEXPECTED-FAIL | element marked as reftest-no-paint got repainted!");
SendFailedNoPaint();
}
}
}
@ -784,6 +784,11 @@ function SendFailedLoad(why)
sendAsyncMessage("reftest:FailedLoad", { why: why });
}
function SendFailedNoPaint()
{
sendAsyncMessage("reftest:FailedNoPaint");
}
function SendEnableAsyncScroll()
{
sendAsyncMessage("reftest:EnableAsyncScroll");

Просмотреть файл

@ -103,6 +103,7 @@ var gExpectingProcessCrash = false;
var gExpectedCrashDumpFiles = [];
var gUnexpectedCrashDumpFiles = { };
var gCrashDumpDir;
var gFailedNoPaint = false;
const TYPE_REFTEST_EQUAL = '==';
const TYPE_REFTEST_NOTEQUAL = '!=';
@ -1551,12 +1552,21 @@ function RecordResult(testRunTime, errorMsg, scriptResults)
}
// whether the comparison result matches what is in the manifest
var test_passed = (equal == (gURLs[0].type == TYPE_REFTEST_EQUAL));
var test_passed = (equal == (gURLs[0].type == TYPE_REFTEST_EQUAL)) && !gFailedNoPaint;
output = outputs[expected][test_passed];
++gTestResults[output.n];
// It's possible that we failed both reftest-no-paint and the normal comparison, but we don't
// have a way to annotate these separately, so just print an error for the no-paint failure.
if (gFailedNoPaint) {
if (expected == EXPECTED_FAIL) {
gDumpLog("REFTEST TEST-KNOWN-FAIL | " + gURLs[0].prettyPath + " | failed reftest-no-paint\n");
} else {
gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | " + gURLs[0].prettyPath + " | failed reftest-no-paint\n");
}
} else {
var result = "REFTEST " + output.s + " | " +
gURLs[0].prettyPath + " | "; // the URL being tested
switch (gURLs[0].type) {
@ -1584,6 +1594,7 @@ function RecordResult(testRunTime, errorMsg, scriptResults)
}
gDumpLog(result);
}
if (!test_passed && expected == EXPECTED_PASS) {
FlushTestLog();
@ -1672,6 +1683,7 @@ function FinishTestItem()
// and tests will continue.
SetAsyncScroll(false);
SendClear();
gFailedNoPaint = false;
}
function DoAssertionCheck(numAsserts)
@ -1767,6 +1779,10 @@ function RegisterMessageListenersAndLoadContentScript()
"reftest:FailedLoad",
function (m) { RecvFailedLoad(m.json.why); }
);
gBrowserMessageManager.addMessageListener(
"reftest:FailedNoPaint",
function (m) { RecvFailedNoPaint(); }
);
gBrowserMessageManager.addMessageListener(
"reftest:InitCanvasWithSnapshot",
function (m) { return RecvInitCanvasWithSnapshot(); }
@ -1828,6 +1844,11 @@ function RecvFailedLoad(why)
LoadFailed(why);
}
function RecvFailedNoPaint()
{
gFailedNoPaint = true;
}
function RecvInitCanvasWithSnapshot()
{
var painted = InitCurrentCanvasWithSnapshot();