Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / response-json-bad-encoding.html
blobd594d39d984187fee0b69aa39678069a740578c0
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script>
6 <script type="text/javascript">
7 var test = async_test("Let XMLHttpRequest with responseType set to json handle non-UTF-8 file.");
9 test.step(function()
11 var xhr = new XMLHttpRequest;
13 xhr.responseType = "json";
14 assert_equals(xhr.responseType, "json", "xhr.responseType");
16 xhr.onreadystatechange = test.step_func(function()
18 if (xhr.readyState != 4)
19 return;
21 assert_equals(xhr.status, 200, "xhr.status");
22 assert_equals(xhr.response, "\uFFFD", "xhr.response");
23 test.done();
24 });
26 xhr.open('GET', 'resources/invalid-utf8-json.pl', true);
27 xhr.send();
28 });
29 </script>
30 </body>
31 </html>