content/base/test/test_bug484396.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.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=484396
     5 -->
     6 <head>
     7   <title>Test for Bug 484396</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    10 </head>
    11 <body>
    12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=484396">Mozilla Bug 484396</a>
    13 <p id="display"></p>
    14 <div id="content" style="display: none">
    16 </div>
    17 <pre id="test">
    18 <script type="application/javascript">
    19 SimpleTest.waitForExplicitFinish();
    21 var msg = 'xhr.open() succeeds with empty url';
    22 var xhr = new XMLHttpRequest();
    24 try {
    25   xhr.open('GET', '');
    26   ok(true, msg);
    27 } catch (e) {
    28   ok(false, msg);
    29 }
    31 xhr.onerror = function () {
    32   ok(false, 'xhr.send() succeeds with empty url');
    33 }
    35 xhr.onreadystatechange = function () {
    36   if (4 == xhr.readyState) {
    37     is(xhr.status, 200, 'xhr.status is 200 OK');
    38     ok(-1 < xhr.responseText.indexOf('Bug 484396'), 'xhr.responseText contains the calling page');
    40     SimpleTest.finish();
    41   }
    42 };
    44 xhr.send('');
    45 </script>
    46 </pre>
    47 </body>
    48 </html>

mercurial