Bug 1161072 - Ensure webconsole test do have pending request on test end. r=pbrosset

This commit is contained in:
Alexandre Poirot 2015-06-01 18:18:09 +02:00
parent d51ccd66b7
commit d9cecc6e42
2 changed files with 15 additions and 2 deletions

View File

@ -3160,6 +3160,12 @@ Widgets.ObjectRenderers.add({
"message was got cleared away");
}
// Check it again as this method is async!
if (this._linkedToInspector) {
return;
}
this._linkedToInspector = true;
this.highlightDomNode = this.highlightDomNode.bind(this);
this.element.addEventListener("mouseover", this.highlightDomNode, false);
this.unhighlightDomNode = this.unhighlightDomNode.bind(this);
@ -3170,8 +3176,6 @@ Widgets.ObjectRenderers.add({
onClick: this.openNodeInInspector.bind(this)
});
this._openInspectorNode.title = l10n.getStr("openNodeInInspector");
this._linkedToInspector = true;
}),
/**

View File

@ -62,11 +62,13 @@ function test() {
let onInspectorSelected = toolbox.once("inspector-selected");
let onInspectorUpdated = inspector.once("inspector-updated");
let onNewNode = toolbox.selection.once("new-node-front");
let onNodeHighlight = toolbox.once("node-highlight");
EventUtils.synthesizeMouseAtCenter(inspectorIcon, {},
inspectorIcon.ownerDocument.defaultView);
yield onInspectorSelected;
yield onInspectorUpdated;
yield onNodeHighlight;
let nodeFront = yield onNewNode;
ok(true, "Inspector selected and new node got selected");
@ -79,6 +81,13 @@ function test() {
is(attrs[i].value, data.attrs[i].value, "The correct node was highlighted");
}
info("Unhighlight the node by moving away from the markup view");
let onNodeUnhighlight = toolbox.once("node-unhighlight");
let btn = inspector.toolbox.doc.querySelector(".toolbox-dock-button");
EventUtils.synthesizeMouseAtCenter(btn, {type: "mousemove"},
inspector.toolbox.doc.defaultView);
yield onNodeUnhighlight;
info("Switching back to the console");
yield toolbox.selectTool("webconsole");
}