<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script>
window.jsTestIsAsync = true;
description('Tests XMLHttpRequest.responseType of "json" fails to parse if the payload was encoded with UTF-16.');

var jsonXHR = new XMLHttpRequest();
var textXHR = new XMLHttpRequest();
var jsonUrl = 'resources/xmlhttprequest-responsetype-json-utf-16.json';

jsonXHR.open('GET', jsonUrl);
jsonXHR.responseType = 'json';
jsonXHR.onload = function() {
    shouldBeNull('jsonXHR.response');
    finishJSTest();
};
jsonXHR.onerror = function() {
    testFailed('An error occurred while loading "' + jsonUrl + '"');
    finishJSTest();
};
jsonXHR.send(null);
</script>
<script src="../../resources/js-test-post.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
</body>
</html>
