tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_url_empty_port.html (1636B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=930450
      5 -->
      6 <head>
      7  <meta charset="utf-8">
      8  <title>Test for Bug 930450</title>
      9  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     11 </head>
     12 <body>
     13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=930450">Mozilla Bug 930450</a>
     14 <p id="display"></p>
     15 <div id="content" style="display: none">
     16  <iframe name="x" id="x"></iframe>
     17  <iframe name="y" id="y"></iframe>
     18 </div>
     19 <pre id="test">
     20 </pre>
     21  <a id="link" href="http://www.example.com:8080">foobar</a>
     22  <area id="area" href="http://www.example.com:8080" />
     23  <script type="application/javascript">
     24 
     25  var url = new URL("http://www.example.com:8080");
     26  is(url.port, "8080", "URL.port is 8080");
     27  url.port = "";
     28  is(url.port, "", "URL.port is ''");
     29  url.port = 0;
     30  is(url.port, "0", "URL.port is 0");
     31 
     32  var link = document.getElementById("link");
     33  is(link.port, "8080", "URL.port is 8080");
     34  link.port = "";
     35  is(link.href, "http://www.example.com/", "link.href matches");
     36  is(link.port, "", "URL.port is ''");
     37  link.port = 0;
     38  is(link.href, "http://www.example.com:0/", "link.href matches");
     39  is(link.port, "0", "URL.port is 0");
     40 
     41  var area = document.getElementById("area");
     42  is(area.port, "8080", "URL.port is 8080");
     43  area.port = "";
     44  is(area.href, "http://www.example.com/", "area.href matches");
     45  is(area.port, "", "URL.port is ''");
     46  area.port = 0;
     47  is(area.href, "http://www.example.com:0/", "area.href matches");
     48  is(area.port, "0", "URL.port is 0");
     49 
     50  </script>
     51 </body>
     52 </html>