diff --git a/services/sync/tests/unit/test_resource.js b/services/sync/tests/unit/test_resource.js index ba448f18350..ab621e1bd20 100644 --- a/services/sync/tests/unit/test_resource.js +++ b/services/sync/tests/unit/test_resource.js @@ -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); } diff --git a/services/sync/tests/unit/test_resource_async.js b/services/sync/tests/unit/test_resource_async.js index 2e1603849c2..028090556db 100644 --- a/services/sync/tests/unit/test_resource_async.js +++ b/services/sync/tests/unit/test_resource_async.js @@ -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.