Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 196 lines (162 sloc) 4.844 kb
648bc48 *** empty log message ***
edwardhieatt authored
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
2 "http://www.w3.org/TR/html4/frameset.dtd">
3 <html>
4
5 <head>
423db1d no message
edwardhieatt authored
6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
648bc48 *** empty log message ***
edwardhieatt authored
7 <title>JsUnit</title>
8 <script language="JavaScript" type="text/javascript" src="app/xbDebug.js"></script>
047a683 no message
edwardhieatt authored
9 <script language="JavaScript" type="text/javascript" src="app/jsUnitCore.js"></script>
1922b59 no message
edwardhieatt authored
10 <script language="JavaScript" type="text/javascript">
648bc48 *** empty log message ***
edwardhieatt authored
11 var DEFAULT_TEST_FRAME_HEIGHT=250;
12
1c2ecb2 Add support for reporting Mozilla stack traces to exception reporting.
bclary authored
13 // safe, strict access to jsUnitParmHash
14 function jsUnitGetParm(name)
15 {
16 if (typeof(top.jsUnitParmHash[name]) != 'undefined')
17 {
18 return top.jsUnitParmHash[name];
19 }
20 return null;
21 }
648bc48 *** empty log message ***
edwardhieatt authored
22
23 function jsUnitParseParms(string)
24 {
25 var i;
26 var searchString = unescape(string);
1c2ecb2 Add support for reporting Mozilla stack traces to exception reporting.
bclary authored
27 var jsUnitParmHash = new Object();
28
648bc48 *** empty log message ***
edwardhieatt authored
29 if (!searchString)
30 {
1c2ecb2 Add support for reporting Mozilla stack traces to exception reporting.
bclary authored
31 return jsUnitParmHash;
648bc48 *** empty log message ***
edwardhieatt authored
32 }
33
34 i = searchString.indexOf('?');
35 if (i != -1)
36 {
37 searchString = searchString.substring(i+1);
38 }
39
40 var parmList = searchString.split('&');
41 var a;
42 for (i = 0; i < parmList.length; i++)
43 {
44 a = parmList[i].split('=');
45 a[0] = a[0].toLowerCase();
46 if (a.length > 1)
47 {
48 jsUnitParmHash[a[0]] = a[1];
49 }
50 else
51 {
52 jsUnitParmHash[a[0]] = true;
53 }
54 }
1c2ecb2 Add support for reporting Mozilla stack traces to exception reporting.
bclary authored
55 return jsUnitParmHash;
648bc48 *** empty log message ***
edwardhieatt authored
56 }
57
58 function jsUnitConstructTestParms()
59 {
60 var p;
61 var parms = '';
62
63 for (p in jsUnitParmHash)
64 {
1c2ecb2 Add support for reporting Mozilla stack traces to exception reporting.
bclary authored
65 var value = jsUnitParmHash[p];
66
67 if (!value ||
423db1d no message
edwardhieatt authored
68 p == 'testpage' ||
69 p == 'autorun' ||
70 p == 'submitresults' ||
71 p == 'showtestframe' ||
1c2ecb2 Add support for reporting Mozilla stack traces to exception reporting.
bclary authored
72 p == 'resultid')
648bc48 *** empty log message ***
edwardhieatt authored
73 {
1c2ecb2 Add support for reporting Mozilla stack traces to exception reporting.
bclary authored
74 continue;
75 }
76
77 if (parms)
78 {
79 parms += '&';
80 }
648bc48 *** empty log message ***
edwardhieatt authored
81
1c2ecb2 Add support for reporting Mozilla stack traces to exception reporting.
bclary authored
82 parms += p;
648bc48 *** empty log message ***
edwardhieatt authored
83
1c2ecb2 Add support for reporting Mozilla stack traces to exception reporting.
bclary authored
84 if (typeof(value) != 'boolean')
85 {
86 parms += '=' + value;
648bc48 *** empty log message ***
edwardhieatt authored
87 }
88 }
89 return escape(parms);
90 }
91
1c2ecb2 Add support for reporting Mozilla stack traces to exception reporting.
bclary authored
92 var jsUnitParmHash = jsUnitParseParms(document.location.search);
648bc48 *** empty log message ***
edwardhieatt authored
93
1c2ecb2 Add support for reporting Mozilla stack traces to exception reporting.
bclary authored
94 // set to true to turn debugging code on, false to turn it off.
95 xbDEBUG.on = jsUnitGetParm('debug') ? true : false;
648bc48 *** empty log message ***
edwardhieatt authored
96 </script>
97
98 <script language="JavaScript" type="text/javascript" src="app/jsUnitTestManager.js"></script>
99 <script language="JavaScript" type="text/javascript" src="app/jsUnitTracer.js"></script>
100 <script language="JavaScript" type="text/javascript" src="app/jsUnitTestSuite.js"></script>
2c238a3 HTML 4.01 validity fixes (bug 915768)
carnold authored
101 <script language="JavaScript" type="text/javascript">
648bc48 *** empty log message ***
edwardhieatt authored
102
103 var testManager;
104 var utility;
105 var tracer;
106
107
108 var JSUNIT_UNDEFINED_VALUE;
109
110 if (!Array.prototype.push)
111 {
112 Array.prototype.push = function (anObject)
113 {
114 this[this.length] = anObject;
115 }
116 }
117
118 if (!Array.prototype.pop)
119 {
120 Array.prototype.pop = function ()
121 {
122 if (this.length > 0)
123 {
124 delete this[this.length - 1];
125 this.length--;
126 }
127 }
128 }
423db1d no message
edwardhieatt authored
129
648bc48 *** empty log message ***
edwardhieatt authored
130 function shouldKickOffTestsAutomatically() {
1c2ecb2 Add support for reporting Mozilla stack traces to exception reporting.
bclary authored
131 return jsUnitGetParm('autorun')=="true";
648bc48 *** empty log message ***
edwardhieatt authored
132 }
133
134 function shouldShowTestFrame() {
1c2ecb2 Add support for reporting Mozilla stack traces to exception reporting.
bclary authored
135 return jsUnitGetParm('showtestframe');
648bc48 *** empty log message ***
edwardhieatt authored
136 }
423db1d no message
edwardhieatt authored
137
648bc48 *** empty log message ***
edwardhieatt authored
138 function shouldSubmitResults() {
1c2ecb2 Add support for reporting Mozilla stack traces to exception reporting.
bclary authored
139 return jsUnitGetParm('submitresults');
648bc48 *** empty log message ***
edwardhieatt authored
140 }
423db1d no message
edwardhieatt authored
141
648bc48 *** empty log message ***
edwardhieatt authored
142 function getResultId() {
423db1d no message
edwardhieatt authored
143 if (jsUnitGetParm('resultid'))
1c2ecb2 Add support for reporting Mozilla stack traces to exception reporting.
bclary authored
144 return jsUnitGetParm('resultid');
648bc48 *** empty log message ***
edwardhieatt authored
145 return "";
146 }
147
148 function submitResults() {
149 window.mainFrame.mainData.document.testRunnerForm.runButton.disabled=true;
423db1d no message
edwardhieatt authored
150 window.mainFrame.mainResults.populateHeaderFields(getResultId(), navigator.userAgent, JSUNIT_VERSION, testManager.resolveUserEnteredTestFileName());
270885f *** empty log message ***
edwardhieatt authored
151 window.mainFrame.mainResults.submitResults();
648bc48 *** empty log message ***
edwardhieatt authored
152 }
423db1d no message
edwardhieatt authored
153
648bc48 *** empty log message ***
edwardhieatt authored
154 function wasResultUrlSpecified() {
1c2ecb2 Add support for reporting Mozilla stack traces to exception reporting.
bclary authored
155 return shouldSubmitResults() && jsUnitGetParm('submitresults')!='true';
648bc48 *** empty log message ***
edwardhieatt authored
156 }
423db1d no message
edwardhieatt authored
157
648bc48 *** empty log message ***
edwardhieatt authored
158 function getSpecifiedResultUrl() {
423db1d no message
edwardhieatt authored
159 return jsUnitGetParm('submitresults');
648bc48 *** empty log message ***
edwardhieatt authored
160 }
423db1d no message
edwardhieatt authored
161
eae37dd Fix for bug when running over HTTP where the submitResult URL wasn't …
edwardhieatt authored
162 function init() {
d4e60e7 no message
edwardhieatt authored
163 var testRunnerFrameset = document.getElementById('testRunnerFrameset');
164 if (shouldShowTestFrame() && testRunnerFrameset) {
648bc48 *** empty log message ***
edwardhieatt authored
165 var testFrameHeight;
d4e60e7 no message
edwardhieatt authored
166 if (jsUnitGetParm('showtestframe')=='true')
423db1d no message
edwardhieatt authored
167 testFrameHeight=DEFAULT_TEST_FRAME_HEIGHT;
168 else
1c2ecb2 Add support for reporting Mozilla stack traces to exception reporting.
bclary authored
169 testFrameHeight=jsUnitGetParm('showtestframe');
d4e60e7 no message
edwardhieatt authored
170 testRunnerFrameset.rows='*,0,' + testFrameHeight;
648bc48 *** empty log message ***
edwardhieatt authored
171 }
172 testManager = new jsUnitTestManager();
466a258 no message
edwardhieatt authored
173 tracer = new JsUnitTracer(testManager);
648bc48 *** empty log message ***
edwardhieatt authored
174 if (shouldKickOffTestsAutomatically()) {
175 window.mainFrame.mainData.kickOffTests();
176 }
177 }
423db1d no message
edwardhieatt authored
178
d4e60e7 no message
edwardhieatt authored
179
648bc48 *** empty log message ***
edwardhieatt authored
180 </script>
181 </head>
182
2c238a3 HTML 4.01 validity fixes (bug 915768)
carnold authored
183 <frameset id="testRunnerFrameset" rows="*,0,0" onload="init()">
648bc48 *** empty log message ***
edwardhieatt authored
184
2c238a3 HTML 4.01 validity fixes (bug 915768)
carnold authored
185 <frame frameborder="0" name="mainFrame" src="./app/main-frame.html">
186 <frame frameborder="0" name="documentLoader" src="./app/main-loader.html">
187 <frame frameborder="0" name="testContainer" src="./app/testContainer.html">
648bc48 *** empty log message ***
edwardhieatt authored
188
189 <noframes>
190 <body>
191 <p>Sorry, JsUnit requires support for frames.</p>
192 </body>
193 </noframes>
194 </frameset>
195
1922b59 no message
edwardhieatt authored
196 </html>
Something went wrong with that request. Please try again.