blob: 874efea80ecc2cdc0aa6b5b0b78a8e7fb6fd91b9 [file] [log] [blame]
<html>
<body>
<div id="description"></div>
<div id="console"></div>
<script src="../../resources/js-test.js"></script>
<script>
description('This test checks if setting non-supported type does not throw an exception');
var xhr = new XMLHttpRequest();
xhr.open('GET', 'resources/plist.app', true);
// Setting valid type does change the responseType value.
["", "arraybuffer", "blob", "document", "json", "text", "legacystream"].forEach(function(type) {
xhr.responseType = type;
shouldBeEqualToString('xhr.responseType', type);
});
// Setting invalid type should not throw an exception.
shouldNotThrow('xhr.responseType = "dkjdfkjdfkj"');
// Setting invalid type doesn not change the responseType value.
shouldBeEqualToString('xhr.responseType = "text"; xhr.responseType = "asdfasdfasd"; xhr.responseType', 'text');
</script>
</body>