Bug 980835 - Fix for intermittent | browser_webconsole_output_dom_elements_02.js | The current inspector selection is correct - Got [object HTMLParagraphElement], expected [object HTMLBodyElement]; r=me

This commit is contained in:
Mihai Sucan 2014-03-08 23:13:59 +02:00
parent 7ebdc14a3b
commit e429f95666
3 changed files with 14 additions and 4 deletions

View File

@ -90,6 +90,10 @@ exports.RuleViewTool = RuleViewTool;
RuleViewTool.prototype = {
onSelect: function RVT_onSelect(aEvent) {
if (!this.view) {
// Skip the event if RuleViewTool has been destroyed.
return;
}
this.view.setPageStyle(this.inspector.pageStyle);
if (!this.inspector.selection.isConnected() ||
@ -158,6 +162,10 @@ exports.ComputedViewTool = ComputedViewTool;
ComputedViewTool.prototype = {
onSelect: function CVT_onSelect(aEvent)
{
if (!this.view) {
// Skip the event if ComputedViewTool has been destroyed.
return;
}
this.view.setPageStyle(this.inspector.pageStyle);
if (!this.inspector.selection.isConnected() ||

View File

@ -524,6 +524,7 @@ Messages.BaseMessage.prototype = {
for (let widget of this.widgets) {
widget.destroy();
}
this.widgets.clear();
}
}; // Messages.BaseMessage.prototype

View File

@ -38,8 +38,9 @@ function test() {
// Loading the inspector panel at first, to make it possible to listen for
// new node selections
yield toolbox.loadTool("inspector");
let inspector = toolbox.getPanel("inspector");
yield toolbox.selectTool("inspector");
let inspector = toolbox.getCurrentPanel();
yield toolbox.selectTool("webconsole");
info("Iterating over the test data");
for (let data of TEST_DATA) {
@ -60,8 +61,8 @@ function test() {
ok(true, "Inspector selected and new node got selected");
let rawNode = content.wrappedJSObject[data.input.replace(/\(\)/g, "")]();
is(rawNode, inspector.selection.node.wrappedJSObject,
"The current inspector selection is correct");
is(inspector.selection.node.wrappedJSObject, rawNode,
"The current inspector selection is correct");
info("Switching back to the console");
yield toolbox.selectTool("webconsole");