Changeset 7879

Show
Ignore:
Timestamp:
03/31/07 14:27:09 (22 months ago)
Author:
alex
Message:

keep the system from throwing errors when a test page that includes dojo but doesn't have a parent harness loads it. We still get success/failure info at the console. Refs #2550

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dojo/trunk/tests/_browserRunner.js

    r7847 r7879  
    188188                tests._groupStarted = function(group){ 
    189189                        // console.debug("_groupStarted", group); 
    190                         getGroupNode(group).className = "inProgress"; 
     190                        var gn = getGroupNode(group); 
     191                        if(gn){ 
     192                                gn.className = "inProgress"; 
     193                        } 
    191194                } 
    192195 
    193196                tests._groupFinished = function(group, success){ 
    194197                        // console.debug("_groupFinished", group); 
    195                         getGroupNode(group).className = (success) ? "success" : "failure"; 
     198                        var gn = getGroupNode(group); 
     199                        if(gn){ 
     200                                gn.className = (success) ? "success" : "failure"; 
     201                        } 
    196202                } 
    197203 
    198204                tests._testStarted = function(group, fixture){ 
    199205                        // console.debug("_testStarted", group, fixture.name); 
    200                         getFixtureNode(group, fixture).className = "inProgress"; 
     206                        var fn = getFixtureNode(group, fixture); 
     207                        if(fn){ 
     208                                fn.className = "inProgress"; 
     209                        } 
    201210                        fixture.startTime = new Date(); 
    202211                } 
     
    204213                tests._testFinished = function(group, fixture, success){ 
    205214                        var fn = getFixtureNode(group, fixture); 
    206                         fn.getElementsByTagName("td")[2].innerHTML = ((new Date())-fixture.startTime)+"ms"; 
    207                         fn.className = (success) ? "success" : "failure"; 
     215                        if(fn){ 
     216                                fn.getElementsByTagName("td")[2].innerHTML = ((new Date())-fixture.startTime)+"ms"; 
     217                                fn.className = (success) ? "success" : "failure"; 
     218                        } 
    208219                        this.debug(((success) ? "PASSED" : "FAILED"), "test:", fixture.name); 
    209220                } 
     
    269280                        // would be easier w/ query...sigh 
    270281                        runAll = (!runAll); 
     282                        if(!dojo.byId("testList")){ return; } 
    271283                        var tb = byId("testList").tBodies[0]; 
    272284                        var inputs = tb.getElementsByTagName("input");