This commit is contained in:
Dão Gottwald 2011-09-24 12:27:14 +02:00
Родитель 3dfcbfe370 28b18e8b1f
Коммит 424f8c244a
2 изменённых файлов: 4 добавлений и 50 удалений

Просмотреть файл

@ -791,12 +791,6 @@ var InspectorUI = {
*/ */
openInspectorUI: function IUI_openInspectorUI(aNode) 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 // Observer used to inspect the specified element from content after the
// inspector UI has been opened. // inspector UI has been opened.
function inspectObserver(aElement) { function inspectObserver(aElement) {

Просмотреть файл

@ -38,7 +38,6 @@
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
let doc; let doc;
let salutation; let salutation;
let closing;
function createDocument() function createDocument()
{ {
@ -107,59 +106,20 @@ function runContextMenuTest()
function inspectNodesFromContextTest() function inspectNodesFromContextTest()
{ {
Services.obs.removeObserver(inspectNodesFromContextTest, INSPECTOR_NOTIFICATIONS.OPENED, false); 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"); ok(!InspectorUI.inspecting, "Inspector is not actively highlighting");
is(InspectorUI.selection, salutation, "Inspector is highlighting salutation"); is(InspectorUI.selection, salutation, "Inspector is highlighting salutation");
ok(InspectorUI.isTreePanelOpen, "Inspector Tree Panel is open"); ok(InspectorUI.isTreePanelOpen, "Inspector Tree Panel is open");
// TODO: These tests depend on the style inspector patches. // TODO: These tests depend on the style inspector patches.
todo(InspectorUI.isStylePanelOpen, "Inspector Style Panel is open"); todo(InspectorUI.isStylePanelOpen, "Inspector Style Panel is open");
executeSoon(function() { todo(InspectorUI.isDOMPanelOpen, "Inspector DOM Panel is open");
InspectorUI.closeInspectorUI(true); 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!");
} }
function finishInspectorTests() function finishInspectorTests()
{ {
Services.obs.removeObserver(finishInspectorTests, Services.obs.removeObserver(finishInspectorTests,
INSPECTOR_NOTIFICATIONS.CLOSED); INSPECTOR_NOTIFICATIONS.CLOSED, false);
ok(!InspectorUI.highlighter, "Highlighter is gone"); ok(!InspectorUI.highlighter, "Highlighter is gone");
ok(!InspectorUI.isTreePanelOpen, "Inspector Tree Panel is closed"); ok(!InspectorUI.isTreePanelOpen, "Inspector Tree Panel is closed");