main-data.html 7.02 KB
Newer Older
Rafael Monnerat's avatar
Rafael Monnerat committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JsUnit main-data.html</title>
    <link rel="stylesheet" type="text/css" href="../css/jsUnitStyle.css">
    <script language="JavaScript" type="text/javascript" src="jsUnitCore.js"></script>
    <script language="JavaScript" type="text/javascript" src="jsUnitVersionCheck.js"></script>
    <script language="JavaScript" type="text/javascript">

        function pageLoaded() {
            giveFocusToTestFileNameField();
        }

        function giveFocusToTestFileNameField() {
            if (document.testRunnerForm.testFileName.type != "hidden")
                document.testRunnerForm.testFileName.focus();
        }

        function kickOffTests() {
            //
            //    Check if Init was called by onload handler
            //
            if (typeof(top.testManager) == 'undefined') {
                top.init();
            }

            if (isBlank(top.testManager.getTestFileName())) {
                top.testManager.fatalError('No Test Page specified.');
                return;
            }

            top.testManager.setup();

            top.testManager._currentSuite().addTestPage(top.testManager.resolveUserEnteredTestFileName());
            top.tracer.initialize();

            var traceLevel = document.forms.testRunnerForm.traceLevel;
            if (traceLevel.value != '0')
            {
                var traceWindow = top.tracer._getTraceWindow();
                if (traceWindow) {
                    traceWindow.focus();
                }
                else {
                    top.testManager.fatalError('Tracing requires popup windows, and popups are blocked in your browser.\n\nPlease enable popups if you wish to use tracing.');
                }
            }

            top.testManager.start();
        }

    </script>
</head>

<body onload="pageLoaded();">
<table width="100%" cellpadding="0" cellspacing="0" border="0" summary="jsUnit Information" bgcolor="#DDDDDD">
    <tr>
        <td width="1"><a href="http://www.jsunit.net" target="_blank"><img src="../images/logo_jsunit.gif" alt="JsUnit" border="0"/></a></td>
        <td width="50">&nbsp;</td>
        <th nowrap align="left">
            <h4>JsUnit <script language="javascript">document.write(JSUNIT_VERSION);</script> TestRunner</h4>
            <font size="-2"><i>Running on <script language="javascript" type="text/javascript">document.write(navigator.userAgent);</script>
            </i></font>
        </th>

        <td nowrap align="right" valign="middle">
            <font size="-2">
                <b><a href="http://www.jsunit.net/" target="_blank">www.jsunit.net</a></b>&nbsp;&nbsp;<br>
            </font>
            <a href="http://www.pivotalsf.com/" target="top">
                <img border="0" src="../images/powerby-transparent.gif" alt="Powered By Pivotal">
            </a>
        </td>
    </tr>
</table>

<form name="testRunnerForm" action="">
    <script type="text/javascript" language="javascript">
        if (!jsUnitGetParm('testpage')) {
            document.write("<p>Enter the filename of the Test Page to be run:</p>");
        } else {
            document.write("<br>");
        };
    </script>

    <table cellpadding="0" cellspacing="0" border="0" summary="Form for entering test case location">
        <tr>
            <td align="center" valign="middle">
                <script language="JavaScript" type="text/javascript">
                    document.write(top.getDocumentProtocol());
                </script>
            </td>

            <td nowrap align="center" valign="bottom">
                &nbsp;
                <script language="JavaScript" type="text/javascript">
                    var specifiedTestPage = jsUnitGetParm('testpage');
                    if (specifiedTestPage) {
                        var html = '<input type="hidden" name="testFileName" value="';
                        var valueString = '';
                        if ((top.getDocumentProtocol() == 'http://' || top.getDocumentProtocol() == 'https://') && jsUnitGetParm('testpage').indexOf('/') == 0)
                            valueString += top.location.host;
                        valueString += specifiedTestPage;
                        var testParms = top.jsUnitConstructTestParms();
                        if (testParms != '') {
                            valueString += '?';
                            valueString += testParms;
                        }
                        html += valueString;
                        html += '">';
                        html += valueString;
                        document.write(html);
                    } else {
                        if (top.getDocumentProtocol() == 'file:///' && top.browserSupportsReadingFullPathFromFileField())
                            document.write('<input type="file" name="testFileName" size="60">');
                        else
                            document.write('<input type="text" name="testFileName" size="60">');
                    }
                </script>
                <input type="button" name="runButton" value="Run" onclick="kickOffTests()">
            </td>
        </tr>
    </table>
    <br>
    <hr>

    <table cellpadding="0" cellspacing="0" border="0" summary="Choose Trace Level">
        <tr>
            <td nowrap>Trace level:</td>

            <td><select name="traceLevel">
                <option value="0" selected>
                    no tracing
                </option>

                <option value="1">
                    warning (lowest)
                </option>

                <option value="2">
                    info
                </option>

                <option value="3">
                    debug (highest)
                </option>
            </select></td>

            <td>&nbsp;&nbsp;&nbsp;</td>

            <td><input type="checkbox" name="closeTraceWindowOnNewRun" checked></td>
            <td nowrap>Close old trace window on new run</td>

            <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>

            <td nowrap>Page load timeout:</td>
            <td>&nbsp;
                <script language="javascript" type="text/javascript">
                    document.write('<input type="text" size="2" name="timeout" value="' + top.jsUnitTestManager.TESTPAGE_WAIT_SEC + '">');
                </script>
            </td>

            <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>

            <td nowrap>Setup page timeout:</td>
            <td>&nbsp;
                <script language="javascript" type="text/javascript">
                    document.write('<input type="text" size="2" name="setUpPageTimeout" value="' + top.jsUnitTestManager.SETUPPAGE_TIMEOUT + '">');
                </script>
            </td>
        </tr>
    </table>
    <hr>
</form>
</body>
</html>