blob: 855ec5093552bc576c9a311e9b9b2cab749651b8 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilExternalURLLoad();
}
</script>
</head>
<body>
<map name="imagemap">
<area id="area" download="foo" shape="rect" coords="0, 0, 100, 100">
</map>
<img width="100" height="100" usemap="#imagemap"/>
<script>
function click(elmt)
{
if (!window.eventSender) {
alert('Click the area to run the test.');
return;
}
eventSender.mouseMoveTo(elmt.offsetLeft + elmt.offsetWidth / 2, elmt.offsetTop + elmt.offsetHeight / 2);
eventSender.mouseDown();
eventSender.mouseUp();
}
function runTest()
{
var string = "<!doctype html><html><head><title>Title</title><script>if (window.testRunner) testRunner.dumpAsText(); </" + "script></head><body>PASS</body></html>";
var blob = new Blob([string], {type: "text/html"});
var area = document.getElementById("area");
area.href = window.URL.createObjectURL(blob);
click(area);
}
runTest();
</script>
</body>
</html>