netwerk/test/mochitests/test_uri_scheme.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 -->
     5 <head>
     6   <title>Test for URI Manipulation</title>
     7   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     8   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    10 <script type="text/javascript">
    11 function dotest1()
    12 {
    13   SimpleTest.waitForExplicitFinish();
    14   var o = new URL("http://localhost/");
    15   try { o.href = "foopy:bar:baz"; } catch(e) { }
    16   o.protocol = "http:";
    17   o.hostname;
    18   try { o.href = "http://localhost/"; } catch(e) { }
    19   ok(o.protocol, "http:");
    20   dotest2();
    21 }
    23 function dotest2()
    24 {
    25   var o = new URL("http://www.mozilla.org/");
    26   try {
    27       o.href ="aaaaaaaaaaa:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    28   } catch(e) { }
    29   o.hash = "#";
    30   o.pathname = "/";
    31   o.protocol = "http:";
    32   try { o.href = "http://localhost/"; } catch(e) { }
    33   ok(o.protocol, "http:");
    34   SimpleTest.finish();
    35 }
    36 </script>
    37 </head>
    38 <body onload="dotest1();">
    39 <p id="display"></p>
    40 <div id="content" style="display: none"></div>
    41 <pre id="test">
    42 </pre>
    43 </body>
    44 </html>

mercurial