mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 852850 - Add the ability for the reftest framework to test whether an element is painted in invalidation tests. r=roc
This commit is contained in:
parent
21c449fd93
commit
3172956497
@ -442,6 +442,14 @@ function doTest() {
|
||||
}
|
||||
document.addEventListener("MozReftestInvalidate", doTest, false);
|
||||
|
||||
Painting Tests
|
||||
==============
|
||||
|
||||
If an element shouldn't be painted, set the class "reftest-no-paint" on it
|
||||
when doing an invalidation test. Causing a repaint in your
|
||||
MozReftestInvalidate handler (for example, by changing the body's background
|
||||
colour) will accurately test whether the element is painted.
|
||||
|
||||
Zoom Tests
|
||||
==========
|
||||
|
||||
|
@ -234,6 +234,10 @@ function shouldWaitForReftestWaitRemoval(contentRootElement) {
|
||||
.indexOf("reftest-wait") != -1;
|
||||
}
|
||||
|
||||
function getNoPaintElements(contentRootElement) {
|
||||
return contentRootElement.getElementsByClassName('reftest-no-paint');
|
||||
}
|
||||
|
||||
// Initial state. When the document has loaded and all MozAfterPaint events and
|
||||
// all explicit paint waits are flushed, we can fire the MozReftestInvalidate
|
||||
// event and move to the next state.
|
||||
@ -360,6 +364,10 @@ function WaitForTestEnd(contentRootElement, inPrintMode) {
|
||||
// Notify the test document that now is a good time to test some invalidation
|
||||
LogInfo("MakeProgress: dispatching MozReftestInvalidate");
|
||||
if (contentRootElement) {
|
||||
var elements = getNoPaintElements(contentRootElement);
|
||||
for (var i = 0; i < elements.length; ++i) {
|
||||
windowUtils().checkAndClearPaintedState(elements[i]);
|
||||
}
|
||||
var notification = content.document.createEvent("Events");
|
||||
notification.initEvent("MozReftestInvalidate", true, false);
|
||||
contentRootElement.dispatchEvent(notification);
|
||||
@ -408,6 +416,14 @@ function WaitForTestEnd(contentRootElement, inPrintMode) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (contentRootElement) {
|
||||
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!");
|
||||
}
|
||||
}
|
||||
}
|
||||
LogInfo("MakeProgress: Completed");
|
||||
state = STATE_COMPLETED;
|
||||
gFailureReason = "timed out while taking snapshot (bug in harness?)";
|
||||
|
Loading…
Reference in New Issue
Block a user