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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test.js"></script>
<script src="resources/blob-slice-common.js"></script>
<script>
description("Test Blob.slice().");
var sliceTestCases = [
[2, 3, "2"],
[2, 12, "23456789"],
[2, 2, ""],
[2, 1, ""],
[2, -12, ""],
[2, 2147483647, "23456789"],
[2, -2147483648, ""],
[2, 9223372036854775000, "23456789"],
[2, -9223372036854775000, ""],
[-2, -1, "8"],
[-2, -2, ""],
[-2, -3, ""],
[-2, -12, ""],
[-2, 2147483647, "89"],
[-2, -2147483648, ""],
[-2, 9223372036854775000, "89"],
[-2, -9223372036854775000, ""],
[0, null, "0123456789"],
[2, null, "23456789"],
[-2, null, "89"],
[12, null, ""],
[-12, null, "0123456789"],
[2147483647, null, ""],
[-2147483648, null, "0123456789"],
[9223372036854775000, null, ""],
[-9223372036854775000, null, "0123456789"],
[null, null, "0123456789"],
];
function runTests()
{
blob = new Blob(["0123456789"]);
file = new File(["0123456789"], "slice-test.txt");
runNextTest();
}
window.jsTestIsAsync = true;
</script>
</head>
<body onload="runTests()">
<pre id='console'></pre>
</body>
</html>
|