Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
1 function run_test() {
2 var ios = Cc["@mozilla.org/network/io-service;1"].
3 getService(Ci.nsIIOService);
5 var uri1 = ios.newURI("http://example.com#bar", null, null);
6 var uri2 = ios.newURI("http://example.com/#bar", null, null);
7 do_check_true(uri1.equals(uri2));
9 uri1.spec = "http://example.com?bar";
10 uri2.spec = "http://example.com/?bar";
11 do_check_true(uri1.equals(uri2));
13 // see https://bugzilla.mozilla.org/show_bug.cgi?id=665706
14 // ";" is not parsed as special anymore and thus ends up
15 // in the authority component (see RFC 3986)
16 uri1.spec = "http://example.com;bar";
17 uri2.spec = "http://example.com/;bar";
18 do_check_false(uri1.equals(uri2));
20 uri1.spec = "http://example.com#";
21 uri2.spec = "http://example.com/#";
22 do_check_true(uri1.equals(uri2));
24 uri1.spec = "http://example.com?";
25 uri2.spec = "http://example.com/?";
26 do_check_true(uri1.equals(uri2));
28 // see https://bugzilla.mozilla.org/show_bug.cgi?id=665706
29 // ";" is not parsed as special anymore and thus ends up
30 // in the authority component (see RFC 3986)
31 uri1.spec = "http://example.com;";
32 uri2.spec = "http://example.com/;";
33 do_check_false(uri1.equals(uri2));
35 uri1.spec = "http://example.com";
36 uri2.spec = "http://example.com/";
37 do_check_true(uri1.equals(uri2));
38 }