From 28b18e8b1f178d3c01f056c924d3815fb7942e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Sat, 24 Sep 2011 12:26:38 +0200 Subject: [PATCH] Backed out changeset 7e53a3cf73b5 --- browser/devtools/highlighter/inspector.js | 6 --- .../test/browser_inspector_initialization.js | 48 ++----------------- 2 files changed, 4 insertions(+), 50 deletions(-) diff --git a/browser/devtools/highlighter/inspector.js b/browser/devtools/highlighter/inspector.js index a6a095570d8b..e90bf6058c55 100644 --- a/browser/devtools/highlighter/inspector.js +++ b/browser/devtools/highlighter/inspector.js @@ -791,12 +791,6 @@ var InspectorUI = { */ openInspectorUI: function IUI_openInspectorUI(aNode) { - // InspectorUI is already up and running. Lock a node if asked (via context). - if (this.treeLoaded && this.highlighter && aNode) { - this.inspectNode(aNode); - this.stopInspecting(); - return; - } // Observer used to inspect the specified element from content after the // inspector UI has been opened. function inspectObserver(aElement) { diff --git a/browser/devtools/highlighter/test/browser_inspector_initialization.js b/browser/devtools/highlighter/test/browser_inspector_initialization.js index 52103225be9e..657d32f42aa9 100644 --- a/browser/devtools/highlighter/test/browser_inspector_initialization.js +++ b/browser/devtools/highlighter/test/browser_inspector_initialization.js @@ -38,7 +38,6 @@ * ***** END LICENSE BLOCK ***** */ let doc; let salutation; -let closing; function createDocument() { @@ -107,59 +106,20 @@ function runContextMenuTest() function inspectNodesFromContextTest() { Services.obs.removeObserver(inspectNodesFromContextTest, INSPECTOR_NOTIFICATIONS.OPENED, false); - Services.obs.addObserver(openInspectorForContextTest, INSPECTOR_NOTIFICATIONS.CLOSED, false); + Services.obs.addObserver(finishInspectorTests, INSPECTOR_NOTIFICATIONS.CLOSED, false); ok(!InspectorUI.inspecting, "Inspector is not actively highlighting"); is(InspectorUI.selection, salutation, "Inspector is highlighting salutation"); ok(InspectorUI.isTreePanelOpen, "Inspector Tree Panel is open"); // TODO: These tests depend on the style inspector patches. todo(InspectorUI.isStylePanelOpen, "Inspector Style Panel is open"); - executeSoon(function() { - InspectorUI.closeInspectorUI(true); - }); -} - -function openInspectorForContextTest() -{ - Services.obs.removeObserver(openInspectorForContextTest, INSPECTOR_NOTIFICATIONS.CLOSED); - Services.obs.addObserver(inspectNodesFromContextTestWhileOpen, INSPECTOR_NOTIFICATIONS.OPENED, false); - executeSoon(function() { - InspectorUI.openInspectorUI(salutation); - }); -} - -function inspectNodesFromContextTestWhileOpen() -{ - Services.obs.removeObserver(inspectNodesFromContextTestWhileOpen, INSPECTOR_NOTIFICATIONS.OPENED); - Services.obs.addObserver(inspectNodesFromContextTestTrap, INSPECTOR_NOTIFICATIONS.OPENED, false); - Services.obs.addObserver(inspectNodesFromContextTestHighlight, INSPECTOR_NOTIFICATIONS.HIGHLIGHTING, false); - is(InspectorUI.selection, salutation, "Inspector is highlighting salutation"); - closing = doc.getElementById("closing"); - ok(closing, "we have the closing statement"); - executeSoon(function() { - InspectorUI.openInspectorUI(closing); - }); -} - -function inspectNodesFromContextTestHighlight() -{ - Services.obs.removeObserver(inspectNodesFromContextTestHighlight, INSPECTOR_NOTIFICATIONS.HIGHLIGHTING); - Services.obs.addObserver(finishInspectorTests, INSPECTOR_NOTIFICATIONS.CLOSED, false); - is(InspectorUI.selection, closing, "InspectorUI.selection is header"); - executeSoon(function() { - InspectorUI.closeInspectorUI(true); - }); -} - -function inspectNodesFromContextTestTrap() -{ - Services.obs.removeObserver(inspectNodesFromContextTestTrap, INSPECTOR_NOTIFICATIONS.OPENED); - ok(false, "Inspector UI has been opened again. We Should Not Be Here!"); + todo(InspectorUI.isDOMPanelOpen, "Inspector DOM Panel is open"); + InspectorUI.closeInspectorUI(true); } function finishInspectorTests() { Services.obs.removeObserver(finishInspectorTests, - INSPECTOR_NOTIFICATIONS.CLOSED); + INSPECTOR_NOTIFICATIONS.CLOSED, false); ok(!InspectorUI.highlighter, "Highlighter is gone"); ok(!InspectorUI.isTreePanelOpen, "Inspector Tree Panel is closed");