summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/files/null-origin-string.html
blob: 85a0c0a77293d87253fbd86953ac6f545175a82f (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>
<script> /* This script will be executed in a subframe. */
function runTest()
{
    eventSender.beginDragWithFiles(['resources/UTF8.txt']);
    eventSender.mouseMoveTo(20, 20);
    eventSender.mouseUp();
}

function onInputFileChange()
{
    var file = document.getElementById('file').files[0];
    var reader = new FileReader();
    reader.readAsText(file);
    console.log('Started reading...');

    top.location = 'data:text/html,<p>PASS if no crash.</p><script>testRunner.notifyDone()</scr' + 'ipt>';
}
</script>

<script>
if (window.eventSender) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}
document.write('<iframe src="data:text/html,<input type=file id=file onchange=\'onInputFileChange()\'><script>' + document.getElementsByTagName("script")[0].innerText + 'runTest()</scr' + 'ipt>" style="left:0px;top:0px"></iframe>');
</script>

<p>Test that using FileReader from a document with unique origin doesn't cause a crash.</p>
<p>If testing manually, please drop a file on an input above.</p>
</body>
</html>