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