# HG changeset patch # User Tooru Fujisawa # Date 1516919414 -32400 # Node ID 5decaeffb7c0a5af6ec788809b21b83009cbc8f9 # Parent cd18711b6b1fb1dec6823e16772c376d545dbc79 Bug 1430442 - Part 2: Wait for the next event tick after node-highlight event to leave MicroTask checkpoint for the mouse event in devtools/client/inspector/boxmodel/test/browser_boxmodel_guides.js r=pbro diff --git a/devtools/client/inspector/boxmodel/test/browser_boxmodel_guides.js b/devtools/client/inspector/boxmodel/test/browser_boxmodel_guides.js --- a/devtools/client/inspector/boxmodel/test/browser_boxmodel_guides.js +++ b/devtools/client/inspector/boxmodel/test/browser_boxmodel_guides.js @@ -44,13 +44,17 @@ add_task(async function () { async function testGuideOnLayoutHover(elt, expectedRegion, inspector) { info("Synthesizing mouseover on the boxmodel-view"); EventUtils.synthesizeMouse(elt, 2, 2, {type: "mouseover"}, elt.ownerDocument.defaultView); info("Waiting for the node-highlight event from the toolbox"); await inspector.toolbox.once("node-highlight"); + // Wait for the next event tick to make sure the remaining part of the + // test is executed after finishing synthesizing mouse event. + await new Promise(executeSoon); + is(highlightedNodeFront, inspector.selection.nodeFront, "The right nodeFront was highlighted"); is(highlighterOptions.region, expectedRegion, "Region " + expectedRegion + " was highlighted"); }