blob: ee42aa90bddc6ac862c5b00826c69f37e84c0005 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.setShouldLogDownloadCallbacks(true);
testRunner.waitUntilDownloadFinished();
}
</script>
</head>
<body>
<p>
Tests that a suggested filename on a download attribute is allowed if
<a id="dl" download="foo.pdf">the link</a> is a blob URL.
<p>The suggested filename at the top should be foo.pdf.</p>
<script>
function click(elmt)
{
if (!window.eventSender)
return;
eventSender.mouseMoveTo(elmt.offsetLeft + 5, elmt.offsetTop + 5);
eventSender.mouseDown();
eventSender.mouseUp();
}
function runTest()
{
var blob = new Blob(["Hello world!"], {type: "application/octet-stream"});
var link = document.getElementById("dl");
link.href = window.URL.createObjectURL(blob);
click(link);
}
runTest();
</script>
</body>
</html>