test_bug707142.html (1264B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=707142 5 --> 6 <head> 7 <title>Test for Bug 707142</title> 8 <script 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=707142">Mozilla Bug 707142</a> 13 <p id="display"></p> 14 <div id="content" style="display: none"> 15 16 </div> 17 <pre id="test"> 18 <script type="application/javascript"> 19 20 /** Test for Bug 707142 */ 21 22 SimpleTest.waitForExplicitFinish(); 23 24 var xhr = new XMLHttpRequest(); 25 xhr.onload = function() { 26 is(xhr.response.foo, "bar", "Should have gotten bar on baseline"); 27 28 xhr.onload = function() { 29 is(xhr.response.foo, "bar", "Should have gotten bar with BOM"); 30 31 xhr.onload = function() { 32 is(xhr.response, null, "Should have gotten null response with UTF-16 JSON"); 33 34 SimpleTest.finish(); 35 }; 36 xhr.open("GET", "file_bug707142_utf-16.json"); 37 xhr.responseType = "json"; 38 xhr.send(); 39 }; 40 xhr.open("GET", "file_bug707142_bom.json"); 41 xhr.responseType = "json"; 42 xhr.send(); 43 }; 44 xhr.open("GET", "file_bug707142_baseline.json"); 45 xhr.responseType = "json"; 46 xhr.send(); 47 48 </script> 49 </pre> 50 </body> 51 </html>