summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/files/blob-slice-overflow.html
blob: 9b0ab8d6fc365f516136ef199489093192a16a3b (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
<html>
<body>
The excessive length passed to Blob.slice() should be trapped and result in
a truncated slice being returned.
<pre id='console'></pre>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone()
}

var text = '';
for (var i = 0; i < 2000; ++i)
    text += 'A';

blob = new Blob([text]);
slicedBlob = blob.slice(1999, 9223372036854775000);

document.getElementById('console').appendChild(document.createTextNode('Blob slice length: ' + slicedBlob.size));
if (slicedBlob.size != 1) {
    document.getElementById('console').appendChild(document.createTextNode('FAIL'));
}

if (window.testRunner) {
  testRunner.notifyDone();
}
</script>
</body>
</html>