summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/files/file-reader-directory-crash.html
blob: 079f6bfba3f006646934aadd66ced73162805be4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html>
<body>
<input type=file id=file onchange='onInputFileChange()'>
<p id=status>To test manually, drag a directory to the file input above.</p>
<script>
var input = document.getElementsByTagName("input")[0];
var statusElement = document.getElementById("status");

function onInputFileChange()
{
    var file = document.getElementById('file').files[0];
    var reader = new FileReader();
    statusElement.textContent = "Starting test...";
    reader.readAsText(file);
    reader.onloadend = function() {
        statusElement.textContent = "PASS, no crash";
        if (window.testRunner)
            testRunner.notifyDone();
    }
}

if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

eventSender.beginDragWithFiles(['resources']);
eventSender.mouseMoveTo(input.offsetLeft + 1, input.offsetTop + 1);
eventSender.mouseUp();

</script>
</body>
</html>