dom/base/test/test_url_empty_port.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial