Bug 1123948 - Wait for _applyingModifications to finish before checking computed style in livepreview test. r=pbrosset

This commit is contained in:
Brian Grinstead 2015-02-18 09:43:00 -05:00
Родитель a8e049ece0
Коммит dc83310391
1 изменённых файлов: 7 добавлений и 5 удалений

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

@ -37,7 +37,6 @@ add_task(function*() {
}
});
function* testLivePreviewData(data, ruleView, selector) {
let testElement = getNode(selector);
let idRuleEditor = getRuleViewRuleEditor(ruleView, 1);
@ -57,10 +56,13 @@ function* testLivePreviewData(data, ruleView, selector) {
EventUtils.synthesizeKey("VK_RETURN", {});
}
// This wait is an orange waiting to happen, but it might take a few event
// loop spins in either the client or parent process before we see the
// updated value.
yield wait(1);
// Wait for the modifyproperties request to complete before
// checking the computed style.
for (let rule of ruleView._elementStyle.rules) {
if (rule._applyingModifications) {
yield rule._applyingModifications;
}
}
// While the editor is still focused in, the display should have changed already
is((yield getComputedStyleProperty(selector, null, "display")),