blob: 5def0c633a46c98220cd263e96011571d04604ce [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../../../resources/js-test.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("Test that filename passed to FormData.append() takes precedence over default Blob filename 'blob', even if empty.");
self.jsTestIsAsync = true;
function runTest()
{
debug("Sending FormData containing one blob with custom empty filename:");
var formData = new FormData;
formData.append("blob", new Blob([""]), "");
var xhr = new XMLHttpRequest();
xhr.open("POST", "http://127.0.0.1:8000/xmlhttprequest/resources/multipart-post-echo-filenames.php", true);
xhr.onload = function() {
filename = xhr.responseText;
shouldBe("filename", "''");
finishJSTest();
}
xhr.send(formData);
}
runTest();
var successfullyParsed = true;
</script>
</body>
</html>