content/base/test/test_XHR_header.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 <head>
     4   <title>Test for XMLHttpRequest.GetResponseHeader(foo) byte-inflates the output</title>
     5   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     6   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     7   <meta charset="utf-8">
     8 </head>
     9 <body>
    10 <p id="display"></p>
    11 <div id="content" style="display: none">
    13 </div>
    14 <pre id="test">
    15 <script class="testbody" type="application/javascript;version=1.7">
    16 "use strict";
    17 SimpleTest.waitForExplicitFinish();
    19 let xhr = new XMLHttpRequest();
    20 xhr.open('GET', 'file_XHR_header.sjs', true);
    21 xhr.onreadystatechange = function() {
    22   if (xhr.readyState == 4) {
    23     ok(xhr.getResponseHeader('X-Custom-Header-Bytes') == "\xE2\x80\xA6", 'getResponseHeader byte-inflates the output');
    24     SimpleTest.finish();
    25   }
    26 }
    27 xhr.send(null);
    28 </script>
    29 </pre>
    30 </body>
    31 </html>

mercurial