diff --git a/browser/devtools/styleinspector/test/browser_ruleview_livepreview.js b/browser/devtools/styleinspector/test/browser_ruleview_livepreview.js index 622bfc8b18fa..c51e70e6fd62 100644 --- a/browser/devtools/styleinspector/test/browser_ruleview_livepreview.js +++ b/browser/devtools/styleinspector/test/browser_ruleview_livepreview.js @@ -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")),