Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / modules / libjar / test / unit / test_bug278262.js
blobed546b64e9e10578327e893b871510946950b66e
1 // Regression test for bug 278262 - JAR URIs should resolve relative URIs in the base section.
3 const Cc = Components.classes;
4 const Ci = Components.interfaces;
5 const path = "modules/libjar/test/unit/data/test_bug333423.zip";
7 function test_relative_sub() {
8 var ios = Cc["@mozilla.org/network/io-service;1"].
9 getService(Ci.nsIIOService);
11 var spec = "jar:" + ios.newFileURI(do_get_file(path)).spec + "!/";
12 var base = ios.newURI(spec, null, null);
13 var uri = ios.newURI("../modules/libjar", null, base);
15 // This is the URI we expect to see.
16 var expected = "jar:" + ios.newFileURI(do_get_file(path)).spec +
17 "!/modules/libjar";
19 do_check_eq(uri.spec, expected);
22 function test_relative_base() {
23 var ios = Cc["@mozilla.org/network/io-service;1"].
24 getService(Ci.nsIIOService);
26 var base = ios.newFileURI(do_get_file("netwerk/Makefile.in"));
27 var uri = ios.newURI("jar:../" + path + "!/", null, base);
29 // This is the URI we expect to see.
30 var expected = "jar:" + ios.newFileURI(do_get_file(path)).spec +
31 "!/";
33 do_check_eq(uri.spec, expected);
36 function run_test() {
37 test_relative_sub();
38 test_relative_base();