function runTest()
{
    FBTest.sysout("issue4724.START");

    var url = basePath + "script/4724/issue4724.html";
    FBTest.openNewTab(url, function(win)
    {
        var line = 8;

        FBTest.enableScriptPanel(function(win)
        {
            FBTest.setBreakpoint(null, url, line, null, function()
            {
                var contextMenu = FW.FBL.$("fbContextMenu");
                var menuItemLabel = "Set Breakpoint";

                function onPopupShown(event)
                {
                    contextMenu.removeEventListener("popupshown", onPopupShown, false);

                    // Fire the event handler asynchronously so items
                    // have a chance to be appended.
                    setTimeout(function()
                    {
                        for (var i=0; i<contextMenu.children.length; i++)
                        {
                            var menuItem = contextMenu.children[i];
                            if (menuItem.label == menuItemLabel)
                                break;
                        }

                        FBTest.ok(menuItem, "'" + menuItemLabel  +
                            "' item must be available in the context menu.");

                        if (menuItem)
                        {
                            FBTest.ok(menuItem.getAttribute("checked") == "true",
                                "Menu item must be checked");
                            contextMenu.hidePopup();
                        }

                        contextMenu.hidePopup();
                        FBTest.testDone("issue4724.DONE");
                    }, 10);
                }

                // Wait till the menu is displayed.
                contextMenu.addEventListener("popupshown", onPopupShown, false);

                // Right click on line 8
                var lineNode = FBTest.getSourceLineNode(line).getElementsByClassName(
                    "sourceRowText").item(0);

                var eventDetails = {type: "contextmenu", button: 2};
                FBTest.synthesizeMouse(lineNode, 2, 2, eventDetails);
            });
        });
    });
}

@@ -320,69 +320,8 @@
   %7B%0A
-                var contextMenu = FW.FBL.$(%22fbContextMenu%22);%0A
     
@@ -370,17 +370,16 @@
 point%22;%0A
-%0A
         
@@ -390,144 +390,55 @@
     
-function onPopupShown(event)%0A                %7B%0A                    contextMenu.removeEventListener(%22popupshown%22, onPopupShown, fals
+var lineNode = FBTest.getSourceLineNode(lin
 e);%0A
-%0A
     
@@ -453,155 +453,156 @@
     
-    // Fire the event handler asynchronously so items%0A                    // have a chance to be appended.%0A                    setTimeout(function(
+var target = lineNode.getElementsByClassName(%22firebug-line%22).item(0);%0A                FBTest.showScriptPanelContextMenu(target, function(contextMenu
 )%0A  
@@ -611,34 +611,26 @@
             
- 
-   %7B%0A    
+%7B%0A
             
@@ -703,34 +703,26 @@
             
-    %7B%0A    
+%7B%0A
             
@@ -789,36 +789,32 @@
                 
- 
-   
 if (menuItem.lab
@@ -862,20 +862,16 @@
         
-    
 break;%0A 
@@ -885,35 +885,27 @@
             
- 
-   %7D%0A%0A    
+%7D%0A%0A
             
@@ -979,20 +979,16 @@
         
- 
-   
 %22' item 
@@ -1042,36 +1042,32 @@
                 
-    
 if (menuItem)%0A  
@@ -1080,34 +1080,26 @@
             
- 
-   %7B%0A    
+%7B%0A
             
@@ -1192,20 +1192,16 @@
         
- 
-   
 %22Menu it
@@ -1246,667 +1246,83 @@
     
-        contextMenu.hidePopup();%0A                        %7D%0A%0A                        contextMenu.hidePopup();%0A                        FBTest.testDone(%22issue4724.DONE%22);%0A                    %7D, 10);%0A                %7D%0A%0A                // Wait till the menu is displayed.%0A                contextMenu.addEventListener(%22popupshown%22, onPopupShown, false);%0A%0A                // Right click on line 8%0A                var lineNode = FBTest.getSourceLineNode(line).getElementsByClassName(%0A                    %22sourceRowText%22).item(0);%0A%0A                var eventDetails = %7Btype: %22contextmenu%22, button: 2%7D;%0A                FBTest.synthesizeMouse(lineNode, 2, 2, eventDetails
+%7D%0A%0A                    FBTest.testDone(%22issue4724.DONE%22);%0A                %7D
 );%0A 

fix test script/4724 (related to issue 7166)