blob: 4da639c98ce225773a5c3869dd431330bc50b949 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<input type="file" name="file" id="file" onchange="onInputFileChange()">
<pre id='console'></pre>
<script>
function log(message)
{
document.getElementById('console').appendChild(document.createTextNode(message + "\n"));
}
function onInputFileChange()
{
log("Test that FileReader.abort works.");
var file = document.getElementById("file").files[0];
var reader = new FileReader();
reader.readAsText(file);
reader.onloadstart = function() {
log("Received loadstart event");
reader.abort();
};
reader.onload = function() {
log("Received load event");
};
reader.onloadend = function() {
log("Received loadend event");
log("DONE");
if (testRunner.notifyDone)
testRunner.notifyDone();
};
reader.onabort = function() {
log("Received abort event");
};
reader.onerror = function(event) {
log("Received error event: " + event.target.error.code);
};
}
function runTests()
{
eventSender.beginDragWithFiles(['resources/UTF8.txt']);
eventSender.mouseMoveTo(10, 10);
eventSender.mouseUp();
}
if (window.eventSender) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
window.onload = runTests;
}
</script>
</body>
</html>