From 50d488f4c2137206e63f291ff99c4f09d177d31d Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Tue, 15 Sep 2009 08:00:03 +0000 Subject: Fixed the wildcard match and added a bunch of unit tests. git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@247 119bf307-c92d-0410-89bd-8f53e6181181 --- chrome/content/unittests.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'chrome/content/unittests.html') diff --git a/chrome/content/unittests.html b/chrome/content/unittests.html index 1f84455..cee8488 100644 --- a/chrome/content/unittests.html +++ b/chrome/content/unittests.html @@ -6,7 +6,7 @@ body { font-family: Verdana, Arial; color:black; background-color:white; font-size:0.8em; width:800px; margin:auto; text-align:center;} a { color:blue; } h1 { text-align:center; margin:20px 0px; } - table { margin:auto; border:solid 1px black; width:500px; border-collapse:collapse;} + table { margin:auto; border:solid 1px black; width:700px; border-collapse:collapse;} td { border:solid 1px black; padding:3px; } td.result { width:20px; height:20px; padding:0;} td.result div { width:70%; height:70%; margin:auto; } @@ -45,6 +45,7 @@ } function setup() { + try{ var tables = document.getElementsByTagName('table'); for (var i = 0; i < tables.length; i++) { tables[i].parentNode.removeChild(tables[i]); @@ -56,6 +57,7 @@ for (var name in tests) { setupTest(name, tests[name]); } + }catch(e){alert(e);} } function runTests() { @@ -65,12 +67,12 @@ try { var result = testcase.run(testcase.tests[i]); if (result) { - document.getElementById(testcaseName + '_' + i).style.backgroundColor = 'green'; + document.getElementById(testcaseName + '_' + i).style.backgroundColor = '#17f816'; } else { - document.getElementById(testcaseName + '_' + i).style.backgroundColor = 'red'; + document.getElementById(testcaseName + '_' + i).style.backgroundColor = '#ff0000'; } } catch(e) { - document.getElementById(testcaseName + '_' + i).style.backgroundColor = 'red'; + document.getElementById(testcaseName + '_' + i).style.backgroundColor = '#ff0000'; } } } -- cgit v1.2.3-70-g09d2