// Test entry point.
function runTest()
{
    FBTest.sysout("issue1425.START");
    FBTest.clearCache();

    FBTest.openNewTab(basePath + "script/1425/issue1425.html", function(win)
    {
        var isOpen = FBTest.isFirebugOpen();
        FBTest.sysout("onNewPage starts with isFirebugOpen:"+isOpen+" in "+win.location);
        if (!isOpen)
            FBTest.pressToggleFirebug();

        FBTest.enableScriptPanel(function reloadIt(win)
        {
            FBTest.progress("reloaded, ready to go");

            var panel = FW.Firebug.chrome.selectPanel("script");
            FBTest.progress("Navigated to "+panel.name+" panel");

            // Select proper JS file.
            var found = FBTest.selectPanelLocationByName(panel, "main.js");
            FBTest.compare(found, true, "The main.js should be found");

            var panel = FW.Firebug.chrome.getSelectedPanel();
            var selectedLocationDescription = panel.getObjectDescription(panel.location);
            FBTest.compare("main.js", selectedLocationDescription.name,
                "The selected location must be main.js");

            var sourceBox = panel.getSourceBoxByURL(panel.getObjectLocation(panel.location));
            var sourceViewport =  FW.FBL.getChildByClass(sourceBox, 'sourceViewport');
            if (sourceViewport)
            {
                var rows = sourceViewport.childNodes;

                FBTest.ok(rows.length > 1, "The script view must not be empty.");
                if (rows.length < 1)
                    FBTest.testDone("issue1425.DONE");

                // Scroll to the line 1
                // (the panel can be scrolled to the last time position by default).
                var url = panel.getObjectLocation(panel.location);
                FBTest.selectSourceLine(url, 1, "js");

                // Verify text on line 1.
                var source1 = "function MapLoadingIndicator(m){\n";
                FBTest.compare(source1, rows[1].firstChild.nextSibling.textContent,
                    "Verify source on line 1");

                // Scroll to 1143
                FBTest.progress("Scroll to line 1143");
                var url = panel.getObjectLocation(panel.location);
                FBTest.selectSourceLine(url, 1143, "js");

                var tries = 5;
                var checking = setInterval( function checkScrolling()
                {
                    FBTest.progress("check scrolling, remaining tries: "+tries);

                    // Look for line 1143
                    var row1143 = FBTest.getSourceLineNode(1143, FW.Firebug.chrome);
                    if (!row1143 && --tries)
                        return;

                    // Check 1143
                    FBTest.ok(row1143, "The row 1143 must exist");
                    if (row1143)
                    {
                        var source1143 = "initialize:function(config){\n";
                        FBTest.compare(source1143, row1143.firstChild.nextSibling.textContent,
                            "The source code at line 1143 verified.");
                    }
                    else
                    {
                        FBTest.sysout("Where is 1143 row in "+url, rows);
                    }

                    clearInterval(checking);
                    FBTest.testDone("issue1425.DONE");
                }, 50);
            }
            else
            {
                FBTest.testDone("issue1425.DONE");
            }
        });
    });
}

@@ -816,24 +816,129 @@
 e found%22);%0A%0A
+            FBTest.waitForDisplayedText(%22script%22, %22MapLoadingIndicator%22, function(row)%0A            %7B%0A    
             
@@ -983,24 +983,28 @@
 tedPanel();%0A
+    
             
@@ -1073,32 +1073,36 @@
 anel.location);%0A
+    
             FBTe
@@ -1169,24 +1169,28 @@
             
+    
 %22The selecte
@@ -1224,713 +1224,8 @@
 );%0A%0A
-            var sourceBox = panel.getSourceBoxByURL(panel.getObjectLocation(panel.location));%0A            var sourceViewport =  FW.FBL.getChildByClass(sourceBox, 'sourceViewport');%0A            if (sourceViewport)%0A            %7B%0A                var rows = sourceViewport.childNodes;%0A%0A                FBTest.ok(rows.length %3E 1, %22The script view must not be empty.%22);%0A                if (rows.length %3C 1)%0A                    FBTest.testDone(%22issue1425.DONE%22);%0A%0A                // Scroll to the line 1%0A                // (the panel can be scrolled to the last time position by default).%0A                var url = panel.getObjectLocation(panel.location);%0A                FBTest.selectSourceLine(url, 1, %22js%22);%0A%0A
     
@@ -1260,17 +1260,19 @@
 n line 1
-.
+143
 %0A       
@@ -1295,1033 +1295,127 @@
 rce1
+143
  = %22
-function MapLoadingIndicator(m)%7B%5Cn%22;%0A                FBTest.compare(source1, rows%5B1%5D.firstChild.nextSibling.textContent,%0A                    %22Verify source on line 1%22);%0A%0A                // Scroll to 1143%0A                FBTest.progress(%22Scroll to line 1143%22);%0A                var url = panel.getObjectLocation(panel.location);%0A                FBTest.selectSourceLine(url, 1143, %22js%22);%0A%0A                var tries = 5;%0A                var checking = setInterval( function checkScrolling()%0A                %7B%0A                    FBTest.progress(%22check scrolling, remaining tries: %22+tries);%0A%0A                    // Look for line 1143%0A                    var row1143 = FBTest.getSourceLineNode(1143, FW.Firebug.chrome);%0A                    if (!row1143 && --tries)%0A                        return;%0A%0A                    // Check 1143%0A                    FBTest.ok(row1143, %22The row 1143 must exist%22);%0A                    if (row1143)%0A                    %7B%0A                        var source1143 = %22initialize:function(config)%7B%5Cn%22
+initialize:function(config)%7B%22;%0A                var line1143 = panel.scriptView.editor.editorObject.getLine(1142)
 ;%0A  
@@ -1424,32 +1424,24 @@
             
-        
 FBTest.compa
@@ -1459,457 +1459,61 @@
 43, 
-row1143.firstChild.nextSibling.textContent,%0A                            %22The source code at line 1143 verified.%22);%0A                    %7D%0A                    else%0A                    %7B%0A                        FBTest.sysout(%22Where is 1143 row in %22+url, rows);%0A                    %7D%0A%0A                    clearInterval(checking);%0A                    FBTest.testDone(%22issue1425.DONE%22);%0A                %7D, 50);%0A            %7D%0A            else%0A            %7B
+line1143, %22The source code at line 1143 verified.%22);%0A
 %0A   
@@ -1573,16 +1573,18 @@
        %7D
+);
 %0A       

Fix test script/1425