netwerk/test/mochitests/test_uri_scheme.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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