Add a test for URI construction and query modification. r=philiKON

This commit is contained in:
Richard Newman 2011-05-26 19:28:25 -07:00
parent 8181b80bb2
commit b4ced7b0da
2 changed files with 29 additions and 0 deletions

View File

@ -485,5 +485,18 @@ function run_test() {
}
do_check_eq(error.result, Cr.NS_ERROR_NET_TIMEOUT);
_("Testing URI construction.");
let args = [];
args.push("newer=" + 1234);
args.push("limit=" + 1234);
args.push("sort=" + 1234);
let query = "?" + args.join("&");
let uri1 = Utils.makeURL("http://foo/" + query);
let uri2 = Utils.makeURL("http://foo/");
uri2.query = query;
do_check_eq(uri1.query, uri2.query);
server.stop(do_test_finished);
}

View File

@ -683,6 +683,22 @@ function run_test() {
next();
}));
}, function (next) {
_("Testing URI construction.");
let args = [];
args.push("newer=" + 1234);
args.push("limit=" + 1234);
args.push("sort=" + 1234);
let query = "?" + args.join("&");
let uri1 = Utils.makeURL("http://foo/" + query);
let uri2 = Utils.makeURL("http://foo/");
uri2.query = query;
do_check_eq(uri1.query, uri2.query);
next();
}, function (next) {
// Don't quit test harness before server shuts down.