Bug 431774: make this test actually test what it was supposed to, instead of always passing, r=biesi

This commit is contained in:
gavin@gavinsharp.com 2008-05-05 14:00:59 -07:00
Родитель aedf8d3e93
Коммит 6241f324d3
1 изменённых файлов: 10 добавлений и 7 удалений

Просмотреть файл

@ -1,5 +1,6 @@
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
function run_test() {
var ios = Cc["@mozilla.org/network/io-service;1"].
@ -9,21 +10,23 @@ function run_test() {
var success = false;
try {
newURI.setSpec("http: //foo.com");
newURI.spec = "http: //foo.com";
}
catch (e) {
success = true;
success = e.result == Cr.NS_ERROR_MALFORMED_URI;
}
if (!success) {
// This is failing: bug 431890
//do_throw("We didn't throw NS_ERROR_MALFORMED_URI when a space was passed in the hostname!");
}
if (!success)
do_throw("We didn't throw when a space was passed in the hostname!");
success = false;
try {
newURI.setHost(" foo.com");
newURI.host = " foo.com";
}
catch (e) {
success = true;
success = e.result == Cr.NS_ERROR_MALFORMED_URI;
}
if (!success)
do_throw("We didn't throw when a space was passed in the hostname!");
do_throw("We didn't throw NS_ERROR_MALFORMED_URI when a space was passed in the hostname!");
}