Changeset 7635

Show
Ignore:
Timestamp:
03/17/07 23:13:39 (22 months ago)
Author:
alex
Message:

ensuring that logging output shows up in the log tab. Refs #2550

Location:
dojo/trunk/tests
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • dojo/trunk/tests/runner.html

    r7624 r7635  
    218218                                <td> 
    219219                                        <div style="position: relative; width: 99%; height: 100%; top: 0px; left: 0px;"> 
    220                                                 <div id="logBody" class="tabBody" 
    221                                                         style="z-index: 1;">thinger blah blah 
     220                                                <div class="tabBody" 
     221                                                        style="z-index: 1;"> 
     222<pre id="logBody"></pre> 
    222223                                                </div> 
    223224                                                <iframe id="testBody" class="tabBody" 
  • dojo/trunk/tests/runner.js

    r7631 r7635  
    497497tests._setupGroupForRun = function(/*String*/ groupName, /*Integer*/ idx){ 
    498498        var tg = this._groups[groupName]; 
    499         this.debug(this._line, "\nGROUP", "\""+groupName+"\"", "has", tg.length, "test"+((tg.length > 1) ? "s" : "")+" to run"); 
     499        this.debug(this._line); 
     500        this.debug("GROUP", "\""+groupName+"\"", "has", tg.length, "test"+((tg.length > 1) ? "s" : "")+" to run"); 
    500501} 
    501502 
     
    517518                var ss = fixture.runTest.toSource(); 
    518519                this.debug("\tERROR IN:\n\t\t", ss); 
     520        }else{ 
     521                this.debug("\tERROR IN:\n\t\t", fixture.runTest); 
    519522        } 
    520523} 
  • dojo/trunk/tests/_browserRunner.js

    r7634 r7635  
    4343                // Over-ride or implement base runner.js-provided methods 
    4444                // 
     45                var _logBacklog = []; 
     46                var sendToLogPane = function(args, skip){ 
     47                        var msg = ""; 
     48                        for(var x=0; x<args.length; x++){ 
     49                                msg += " "+args[x]; 
     50                        } 
     51                        // workarounds for IE. Wheeee!!! 
     52                        msg = msg.replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;"); 
     53                        msg = msg.replace(" ", "&nbsp;"); 
     54                        msg = msg.replace("\n", "<br>&nbsp;"); 
     55                        if(!byId("logBody")){ 
     56                                _logBacklog.push(msg); 
     57                                return; 
     58                        }else if((_logBacklog.length)&&(!skip)){ 
     59                                var tm; 
     60                                while(tm=_logBacklog.shift()){ 
     61                                        sendToLogPane(tm, true); 
     62                                } 
     63                        } 
     64                        var tn = document.createElement("div"); 
     65                        tn.innerHTML = msg; 
     66                        byId("logBody").appendChild(tn); 
     67                } 
     68 
    4569                if(window["console"]){ 
    4670                        if(console.info){ 
    47                                 tests.debug = console.debug; 
     71                                tests.debug = function(){ 
     72                                        sendToLogPane.call(window, arguments); 
     73                                        console.debug.apply(console, arguments); 
     74                                } 
    4875                        }else{ 
    4976                                tests.debug = function(){ 
     77                                        sendToLogPane.apply(window, arguments); 
    5078                                        var msg = ""; 
    5179                                        for(var x=0; x<arguments.length; x++){ 
     
    5482                                        console.log("DEBUG:"+msg); 
    5583                                } 
     84                        } 
     85                }else{ 
     86                        tests.debug = function(){ 
     87                                sendToLogPane.call(window, arguments); 
    5688                        } 
    5789                } 
     
    160192                // Utility code for runner.html 
    161193                // 
     194                // var isSafari = navigator.appVersion.indexOf("Safari") >= 0; 
    162195                var tabzidx = 1; 
     196                var _showTab = function(toShow, toHide){ 
     197                        // FIXME: I don't like hiding things this way. 
     198                        byId(toHide).style.display = "none"; 
     199                        with(byId(toShow).style){ 
     200                                display = ""; 
     201                                zIndex = ++tabzidx; 
     202                        } 
     203                } 
     204 
    163205                showTestPage = function(){ 
    164                         byId("testBody").style.zIndex = ++tabzidx; 
     206                        _showTab("testBody", "logBody"); 
    165207                } 
    166208 
    167209                showLogPage = function(){ 
    168                         byId("logBody").style.zIndex = ++tabzidx; 
     210                        _showTab("logBody", "testBody"); 
    169211                } 
    170212