merge backout
authorDão Gottwald <dao@mozilla.com>
Sat, 24 Sep 2011 12:27:14 +0200
changeset 78763 fecae145d88426c393645596c44c5306c1ddaf48
parent 78761 e88a8b4b16fe7351d4ec3e2bb27f5ba5eb8d1a95 (current diff)
parent 78762 e257e05ef1bfb6e39409efce6671043956d845d9 (diff)
child 78812 95df67109868b0882aeb2adcaad12ca02adaa226
child 78819 2b45524deae5595aff0e9dac2c3d17808b2f02b7
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
merge backout
browser/devtools/highlighter/inspector.js
browser/devtools/highlighter/test/browser_inspector_initialization.js
--- a/browser/devtools/highlighter/inspector.js
+++ b/browser/devtools/highlighter/inspector.js
@@ -786,22 +786,16 @@ var InspectorUI = {
    * resize, tabContainer.TabSelect and others. If a node is provided, then
    * start inspecting it.
    *
    * @param [optional] aNode
    *        The node to inspect.
    */
   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) {
       Services.obs.removeObserver(boundInspectObserver,
                                   INSPECTOR_NOTIFICATIONS.OPENED,
                                   false);
       this.inspectNode(aElement);
       this.stopInspecting();
--- a/browser/devtools/highlighter/test/browser_inspector_initialization.js
+++ b/browser/devtools/highlighter/test/browser_inspector_initialization.js
@@ -33,17 +33,16 @@
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 let doc;
 let salutation;
-let closing;
 
 function createDocument()
 {
   doc.body.innerHTML = '<div id="first" style="{ margin: 10em; ' +
     'font-size: 14pt; font-family: helvetica, sans-serif; color: #AAA}">\n' +
     '<h1>Some header text</h1>\n' +
     '<p id="salutation" style="{font-size: 12pt}">hi.</p>\n' +
     '<p id="body" style="{font-size: 12pt}">I am a test-case. This text exists ' +
@@ -102,69 +101,30 @@ function runContextMenuTest()
   executeSoon(function() {
     InspectorUI.openInspectorUI(salutation);
   });
 }
 
 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");
   ok(!InspectorUI.inspecting, "Inspector is not inspecting");
   ok(InspectorUI.toolbar.hidden, "toolbar is hidden");
 
   gBrowser.removeCurrentTab();
   finish();