зеркало из https://github.com/mozilla/pjs.git
Bug 431774: make this test actually test what it was supposed to, instead of always passing, r=biesi
This commit is contained in:
Родитель
aedf8d3e93
Коммит
6241f324d3
|
@ -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!");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче