diff options
author | Einar Egilsson | 2009-10-07 12:15:09 +0000 |
---|---|---|
committer | Einar Egilsson | 2009-10-07 12:15:09 +0000 |
commit | eb5ee94ad622ac89b886cc74fcb8cd8328b1fbaf (patch) | |
tree | 8e21d340673017d451de704d08eb56e808816332 /chrome/content/unittest/run.html | |
parent | a703799580a208beac24c827fcd54b799f46a3d7 (diff) |
Unittests for nsIContentPolicy implementation
git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@254 119bf307-c92d-0410-89bd-8f53e6181181
Diffstat (limited to 'chrome/content/unittest/run.html')
-rw-r--r-- | chrome/content/unittest/run.html | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/chrome/content/unittest/run.html b/chrome/content/unittest/run.html index 5658137..1557610 100644 --- a/chrome/content/unittest/run.html +++ b/chrome/content/unittest/run.html @@ -27,7 +27,7 @@ row.appendChild(cell);
table.appendChild(row);
cell.innerHTML = name;
- document.getElementsByTagName('body')[0].appendChild(table);
+ document.getElementById('tests').appendChild(table);
for (var i = 0; i < testcase.tests.length; i++) {
var testdata = testcase.tests[i];
row = document.createElement('tr');
@@ -46,17 +46,21 @@ }
function setup() {
- var tables = document.getElementsByTagName('table');
- for (var i = 0; i < tables.length; i++) {
- tables[i].parentNode.removeChild(tables[i]);
- }
+ //quick and dirty cleanup
+ document.getElementById('tests').innerHTML = '';
subscriptLoader.loadSubScript('chrome://redirector/content/code/redirect.js');
subscriptLoader.loadSubScript('chrome://redirector/content/unittest/testcases.js');
redirector.reload();
+ var sorted = [];
for (var name in tests) {
- setupTest(name, tests[name]);
+ sorted.push(name);
}
+
+ sorted.sort();
+ for each(var name in sorted) {
+ setupTest(name, tests[name]);
+ }
}
function runTests() {
@@ -89,5 +93,7 @@ <h1>Redirector Unit Tests</h1>
<button onclick="runTests();">Run tests</button>
<button onclick="setup();">Reload tests</button>
+ <div id="tests">
+ </div>
</body>
</html>
\ No newline at end of file |