netwerk/test/unit/test_bug429347.js

Wed, 31 Dec 2014 06:55:46 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:46 +0100
changeset 1
ca08bd8f51b2
permissions
-rw-r--r--

Added tag TORBROWSER_REPLICA for changeset 6474c204b198

     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 }

mercurial