gecko/netwerk/test/unit/test_bug429347.js

37 lines
1.0 KiB
JavaScript
Raw Normal View History

const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
function run_test() {
var ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
var uri1 = ios.newURI("http://example.com#bar", null, null);
var uri2 = ios.newURI("http://example.com/#bar", null, null);
do_check_true(uri1.equals(uri2));
uri1.spec = "http://example.com?bar";
uri2.spec = "http://example.com/?bar";
do_check_true(uri1.equals(uri2));
uri1.spec = "http://example.com;bar";
uri2.spec = "http://example.com/;bar";
do_check_true(uri1.equals(uri2));
uri1.spec = "http://example.com#";
uri2.spec = "http://example.com/#";
do_check_true(uri1.equals(uri2));
uri1.spec = "http://example.com?";
uri2.spec = "http://example.com/?";
do_check_true(uri1.equals(uri2));
uri1.spec = "http://example.com;";
uri2.spec = "http://example.com/;";
do_check_true(uri1.equals(uri2));
uri1.spec = "http://example.com";
uri2.spec = "http://example.com/";
do_check_true(uri1.equals(uri2));
}