From 79cba78579f5806a1efb8183c496b1017f9fd9cd Mon Sep 17 00:00:00 2001 From: Victor Porof Date: Tue, 13 Mar 2012 19:20:53 +0200 Subject: [PATCH] Bug 735151 - Intermittent browser_tilt_picking_highlight02.js | Highlighting a node didn't work properly and | an unexpected uncaught JS exception reported through window.onerror - this.treePanel is undefined at resource:///modules/inspector.jsm:478; r=rcampbell --- .../tilt/test/browser_tilt_picking_highlight01-offs.js | 4 ++-- .../devtools/tilt/test/browser_tilt_picking_highlight01.js | 4 ++-- .../devtools/tilt/test/browser_tilt_picking_highlight02.js | 4 ++-- .../devtools/tilt/test/browser_tilt_picking_highlight03.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/browser/devtools/tilt/test/browser_tilt_picking_highlight01-offs.js b/browser/devtools/tilt/test/browser_tilt_picking_highlight01-offs.js index 0c7b58b4fed..02606375e00 100644 --- a/browser/devtools/tilt/test/browser_tilt_picking_highlight01-offs.js +++ b/browser/devtools/tilt/test/browser_tilt_picking_highlight01-offs.js @@ -44,6 +44,7 @@ function whenHighlighting() { "Highlighting a node that's not already visible should trigger a reset!"); executeSoon(function() { + Services.obs.removeObserver(whenHighlighting, HIGHLIGHTING); Services.obs.addObserver(whenUnhighlighting, UNHIGHLIGHTING, false); presenter.highlightNode(null); }); @@ -56,14 +57,13 @@ function whenUnhighlighting() { "After unhighlighting a node, it shouldn't be highlighted anymore. D'oh."); executeSoon(function() { + Services.obs.removeObserver(whenUnhighlighting, UNHIGHLIGHTING); Services.obs.addObserver(cleanup, DESTROYED, false); InspectorUI.closeInspectorUI(); }); } function cleanup() { - Services.obs.removeObserver(whenHighlighting, HIGHLIGHTING); - Services.obs.removeObserver(whenUnhighlighting, UNHIGHLIGHTING); Services.obs.removeObserver(cleanup, DESTROYED); gBrowser.removeCurrentTab(); finish(); diff --git a/browser/devtools/tilt/test/browser_tilt_picking_highlight01.js b/browser/devtools/tilt/test/browser_tilt_picking_highlight01.js index 95910e86bca..cf021dcc00a 100644 --- a/browser/devtools/tilt/test/browser_tilt_picking_highlight01.js +++ b/browser/devtools/tilt/test/browser_tilt_picking_highlight01.js @@ -43,6 +43,7 @@ function whenHighlighting() { "Highlighting a node that's already visible shouldn't trigger a reset."); executeSoon(function() { + Services.obs.removeObserver(whenHighlighting, HIGHLIGHTING); Services.obs.addObserver(whenUnhighlighting, UNHIGHLIGHTING, false); presenter.highlightNode(null); }); @@ -55,14 +56,13 @@ function whenUnhighlighting() { "After unhighlighting a node, it shouldn't be highlighted anymore. D'oh."); executeSoon(function() { + Services.obs.removeObserver(whenUnhighlighting, UNHIGHLIGHTING); Services.obs.addObserver(cleanup, DESTROYED, false); InspectorUI.closeInspectorUI(); }); } function cleanup() { - Services.obs.removeObserver(whenHighlighting, HIGHLIGHTING); - Services.obs.removeObserver(whenUnhighlighting, UNHIGHLIGHTING); Services.obs.removeObserver(cleanup, DESTROYED); gBrowser.removeCurrentTab(); finish(); diff --git a/browser/devtools/tilt/test/browser_tilt_picking_highlight02.js b/browser/devtools/tilt/test/browser_tilt_picking_highlight02.js index 85656bb192c..f824b27312d 100644 --- a/browser/devtools/tilt/test/browser_tilt_picking_highlight02.js +++ b/browser/devtools/tilt/test/browser_tilt_picking_highlight02.js @@ -38,6 +38,7 @@ function whenHighlighting() { "After highlighting a node, it should be highlighted. D'oh."); executeSoon(function() { + Services.obs.removeObserver(whenHighlighting, HIGHLIGHTING); Services.obs.addObserver(whenUnhighlighting, UNHIGHLIGHTING, false); presenter.highlightNodeAt(-1, -1); }); @@ -50,14 +51,13 @@ function whenUnhighlighting() { "After unhighlighting a node, it shouldn't be highlighted anymore. D'oh."); executeSoon(function() { + Services.obs.removeObserver(whenUnhighlighting, UNHIGHLIGHTING); Services.obs.addObserver(cleanup, DESTROYED, false); InspectorUI.closeInspectorUI(); }); } function cleanup() { - Services.obs.removeObserver(whenHighlighting, HIGHLIGHTING); - Services.obs.removeObserver(whenUnhighlighting, UNHIGHLIGHTING); Services.obs.removeObserver(cleanup, DESTROYED); gBrowser.removeCurrentTab(); finish(); diff --git a/browser/devtools/tilt/test/browser_tilt_picking_highlight03.js b/browser/devtools/tilt/test/browser_tilt_picking_highlight03.js index 66756081159..5e7cb9af5dc 100644 --- a/browser/devtools/tilt/test/browser_tilt_picking_highlight03.js +++ b/browser/devtools/tilt/test/browser_tilt_picking_highlight03.js @@ -38,6 +38,7 @@ function whenHighlighting() { "After highlighting a node, it should be highlighted. D'oh."); executeSoon(function() { + Services.obs.removeObserver(whenHighlighting, HIGHLIGHTING); Services.obs.addObserver(whenUnhighlighting, UNHIGHLIGHTING, false); presenter.highlightNodeFor(-1); }); @@ -50,14 +51,13 @@ function whenUnhighlighting() { "After unhighlighting a node, it shouldn't be highlighted anymore. D'oh."); executeSoon(function() { + Services.obs.removeObserver(whenUnhighlighting, UNHIGHLIGHTING); Services.obs.addObserver(cleanup, DESTROYED, false); InspectorUI.closeInspectorUI(); }); } function cleanup() { - Services.obs.removeObserver(whenHighlighting, HIGHLIGHTING); - Services.obs.removeObserver(whenUnhighlighting, UNHIGHLIGHTING); Services.obs.removeObserver(cleanup, DESTROYED); gBrowser.removeCurrentTab(); finish();