test_XHR_header.html 868 B

1234567891011121314151617181920212223242526272829303132
  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">
  12. </div>
  13. <pre id="test">
  14. <script class="testbody" type="application/javascript;version=1.7">
  15. "use strict";
  16. SimpleTest.waitForExplicitFinish();
  17. let xhr = new XMLHttpRequest();
  18. xhr.open('GET', 'file_XHR_header.sjs', true);
  19. xhr.onreadystatechange = function() {
  20. if (xhr.readyState == 4) {
  21. ok(xhr.getResponseHeader('X-Custom-Header-Bytes') == "\xE2\x80\xA6", 'getResponseHeader byte-inflates the output');
  22. SimpleTest.finish();
  23. }
  24. }
  25. xhr.send(null);
  26. </script>
  27. </pre>
  28. </body>
  29. </html>