mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Bug 795262. Highlighter test should not depend on MozAfterPaint firing for changes to invisible elements. Also, poll for the value to change instead of assuming a constant 1000ms timeout. r=dao,cjones
This commit is contained in:
parent
6c9ec69e94
commit
ae7293140b
@ -7,7 +7,7 @@ let div;
|
||||
function createDocument()
|
||||
{
|
||||
div = doc.createElement("div");
|
||||
div.setAttribute("style", "width: 100px; height: 100px;");
|
||||
div.setAttribute("style", "width: 100px; height: 100px; background:yellow;");
|
||||
doc.body.appendChild(div);
|
||||
|
||||
Services.obs.addObserver(runTest,
|
||||
@ -27,12 +27,17 @@ function runTest(subject)
|
||||
is(outline.style.width, "100px", "selection has the right width");
|
||||
|
||||
div.style.width = "200px";
|
||||
setTimeout(function () {
|
||||
function pollTest() {
|
||||
if (outline.style.width == "100px") {
|
||||
setTimeout(pollTest, 10);
|
||||
return;
|
||||
}
|
||||
is(outline.style.width, "200px", "selection updated");
|
||||
InspectorUI.closeInspectorUI();
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
}, 1000);
|
||||
}
|
||||
setTimeout(pollTest, 10);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user