OLD | NEW |
1 Test the File constructor. | 1 Test the File constructor. |
2 | 2 |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". |
4 | 4 |
5 | 5 |
6 PASS (new File([], 'world.html')) instanceof window.File is true | 6 PASS (new File([], 'world.html')) instanceof window.File is true |
7 PASS (new File(['hello'], 'world.html')) instanceof window.File is true | 7 PASS (new File(['hello'], 'world.html')) instanceof window.File is true |
8 PASS (new File(['hello'], 'world.html', {})) instanceof window.File is true | 8 PASS (new File(['hello'], 'world.html', {})) instanceof window.File is true |
9 PASS (new File(['hello'], 'world.html', {type:'text/html'})) instanceof window.F
ile is true | 9 PASS (new File(['hello'], 'world.html', {type:'text/html'})) instanceof window.F
ile is true |
10 PASS (new File(['hello'], 'world.html', {type:'text/html', endings:'native'})) i
nstanceof window.File is true | 10 PASS (new File(['hello'], 'world.html', {type:'text/html', endings:'native'})) i
nstanceof window.File is true |
(...skipping 27 matching lines...) Expand all Loading... |
38 PASS (new File([], '')).name is '' | 38 PASS (new File([], '')).name is '' |
39 PASS (new File([], {})).name is '[object Object]' | 39 PASS (new File([], {})).name is '[object Object]' |
40 PASS (new File([], document)).name is '[object HTMLDocument]' | 40 PASS (new File([], document)).name is '[object HTMLDocument]' |
41 PASS (new File([], toStringingObj)).name is 'A string' | 41 PASS (new File([], toStringingObj)).name is 'A string' |
42 PASS (new File([], throwingObj)).name threw exception Error. | 42 PASS (new File([], throwingObj)).name threw exception Error. |
43 PASS (new File([], 'world.html', {unknownKey:'value'})) instanceof window.File i
s true | 43 PASS (new File([], 'world.html', {unknownKey:'value'})) instanceof window.File i
s true |
44 PASS new File([], 'world.html', {endings:'illegalValue'}) threw exception TypeEr
ror: Failed to construct 'File': The "endings" property must be either "transpar
ent" or "native".. | 44 PASS new File([], 'world.html', {endings:'illegalValue'}) threw exception TypeEr
ror: Failed to construct 'File': The "endings" property must be either "transpar
ent" or "native".. |
45 PASS new File([], 'world.html', {endings:throwingObj}) threw exception Error. | 45 PASS new File([], 'world.html', {endings:throwingObj}) threw exception Error. |
46 PASS new File([], 'world.html', {type:throwingObj}) threw exception Error. | 46 PASS new File([], 'world.html', {type:throwingObj}) threw exception Error. |
47 PASS new File([], 'world.html', {type:'helloĆ®'}) threw exception SyntaxError: Fa
iled to construct 'File': The "type" property must consist of ASCII characters.. | 47 PASS new File([], 'world.html', {type:'helloĆ®'}) threw exception SyntaxError: Fa
iled to construct 'File': The "type" property must consist of ASCII characters.. |
| 48 PASS new File([], 'world.html', {lastModifiedDate: 'not a date'}) threw exceptio
n TypeError: Failed to construct 'File': The "lastModifiedDate" property must be
a Date instance.. |
| 49 PASS new File([], 'world.html', {lastModifiedDate: null}) threw exception TypeEr
ror: Failed to construct 'File': The "lastModifiedDate" property must be a Date
instance.. |
| 50 PASS new File([], 'world.html', {lastModifiedDate: Date.now()}) threw exception
TypeError: Failed to construct 'File': The "lastModifiedDate" property must be a
Date instance.. |
48 PASS (new File([], 'world.html', null)) instanceof window.File threw exception T
ypeError: Failed to construct 'File': The 3rd argument is not of type Object.. | 51 PASS (new File([], 'world.html', null)) instanceof window.File threw exception T
ypeError: Failed to construct 'File': The 3rd argument is not of type Object.. |
49 PASS (new File([], 'world.html', undefined)) instanceof window.File threw except
ion TypeError: Failed to construct 'File': The 3rd argument is not of type Objec
t.. | 52 PASS (new File([], 'world.html', undefined)) instanceof window.File threw except
ion TypeError: Failed to construct 'File': The 3rd argument is not of type Objec
t.. |
50 PASS (new File([], 'world.html', 123)) instanceof window.File threw exception Ty
peError: Failed to construct 'File': The 3rd argument is not of type Object.. | 53 PASS (new File([], 'world.html', 123)) instanceof window.File threw exception Ty
peError: Failed to construct 'File': The 3rd argument is not of type Object.. |
51 PASS (new File([], 'world.html', 123.4)) instanceof window.File threw exception
TypeError: Failed to construct 'File': The 3rd argument is not of type Object.. | 54 PASS (new File([], 'world.html', 123.4)) instanceof window.File threw exception
TypeError: Failed to construct 'File': The 3rd argument is not of type Object.. |
52 PASS (new File([], 'world.html', true)) instanceof window.File threw exception T
ypeError: Failed to construct 'File': The 3rd argument is not of type Object.. | 55 PASS (new File([], 'world.html', true)) instanceof window.File threw exception T
ypeError: Failed to construct 'File': The 3rd argument is not of type Object.. |
53 PASS (new File([], 'world.html', 'abc')) instanceof window.File threw exception
TypeError: Failed to construct 'File': The 3rd argument is not of type Object.. | 56 PASS (new File([], 'world.html', 'abc')) instanceof window.File threw exception
TypeError: Failed to construct 'File': The 3rd argument is not of type Object.. |
54 PASS (new File([], 'world.html', [])) instanceof window.File is true | 57 PASS (new File([], 'world.html', [])) instanceof window.File is true |
55 PASS (new File([], 'world.html', /abc/)) instanceof window.File is true | 58 PASS (new File([], 'world.html', /abc/)) instanceof window.File is true |
56 PASS (new File([], 'world.html', function () {})) instanceof window.File is true | 59 PASS (new File([], 'world.html', function () {})) instanceof window.File is true |
57 PASS (new File([], 'world.html', {type:'text/html'})).name is 'world.html' | 60 PASS (new File([], 'world.html', {type:'text/html'})).name is 'world.html' |
58 PASS (new File([], 'world.html', {type:'text/html'})).type is 'text/html' | 61 PASS (new File([], 'world.html', {type:'text/html'})).type is 'text/html' |
59 PASS (new File([], 'world.html', {type:'text/html'})).size is 0 | 62 PASS (new File([], 'world.html', {type:'text/html'})).size is 0 |
60 PASS (new File([], 'world.html', {type:'text/plain;charset=UTF-8'})).type is 'te
xt/plain;charset=utf-8' | 63 PASS (new File([], 'world.html', {type:'text/plain;charset=UTF-8'})).type is 'te
xt/plain;charset=utf-8' |
| 64 PASS (new File([], 'world.html', {lastModifiedDate: aDate})).lastModifiedDate in
stanceof Date is true |
| 65 PASS (new File([], 'world.html', {lastModifiedDate: aDate})).lastModifiedDate.va
lueOf() is aDate.valueOf() |
| 66 PASS (new File([], 'world.html', {lastModifiedDate: new Date(NaN)})).lastModifie
dDate instanceof Date is true |
| 67 PASS (new File([], 'world.html', {lastModifiedDate: new Date(NaN)})).lastModifie
dDate.valueOf() is NaN |
| 68 PASS (new File([], 'world.html')).lastModifiedDate instanceof Date is true |
| 69 PASS Math.abs(Date.now() - (new File([], 'world.html')).lastModifiedDate) <= 100
0 is true |
61 PASS window.File.length is 2 | 70 PASS window.File.length is 2 |
62 PASS new File([new DataView(new ArrayBuffer(100))], 'world.html').size is 100 | 71 PASS new File([new DataView(new ArrayBuffer(100))], 'world.html').size is 100 |
63 PASS new File([new Uint8Array(100)], 'world.html').size is 100 | 72 PASS new File([new Uint8Array(100)], 'world.html').size is 100 |
64 PASS new File([new Uint8ClampedArray(100)], 'world.html').size is 100 | 73 PASS new File([new Uint8ClampedArray(100)], 'world.html').size is 100 |
65 PASS new File([new Uint16Array(100)], 'world.html').size is 200 | 74 PASS new File([new Uint16Array(100)], 'world.html').size is 200 |
66 PASS new File([new Uint32Array(100)], 'world.html').size is 400 | 75 PASS new File([new Uint32Array(100)], 'world.html').size is 400 |
67 PASS new File([new Int8Array(100)], 'world.html').size is 100 | 76 PASS new File([new Int8Array(100)], 'world.html').size is 100 |
68 PASS new File([new Int16Array(100)], 'world.html').size is 200 | 77 PASS new File([new Int16Array(100)], 'world.html').size is 200 |
69 PASS new File([new Int32Array(100)], 'world.html').size is 400 | 78 PASS new File([new Int32Array(100)], 'world.html').size is 400 |
70 PASS new File([new Float32Array(100)], 'world.html').size is 400 | 79 PASS new File([new Float32Array(100)], 'world.html').size is 400 |
(...skipping 20 matching lines...) Expand all Loading... |
91 PASS new File({length: 0}, 'world.txt').size is 0 | 100 PASS new File({length: 0}, 'world.txt').size is 0 |
92 PASS new File({length: 1, 0: 'string'}, 'world.txt').size is 6 | 101 PASS new File({length: 1, 0: 'string'}, 'world.txt').size is 6 |
93 PASS new File({length: 2, 0: new Uint8Array(100), 1: new Int16Array(100)}, 'worl
d.txt').size is 300 | 102 PASS new File({length: 2, 0: new Uint8Array(100), 1: new Int16Array(100)}, 'worl
d.txt').size is 300 |
94 PASS new File({length: 1, 0: 'string'}, 'world.txt', {type: 'text/html'}).type i
s 'text/html' | 103 PASS new File({length: 1, 0: 'string'}, 'world.txt', {type: 'text/html'}).type i
s 'text/html' |
95 PASS new File({length: 0}, 'world.txt', {endings:'illegal'}) threw exception Typ
eError: Failed to construct 'File': The "endings" property must be either "trans
parent" or "native".. | 104 PASS new File({length: 0}, 'world.txt', {endings:'illegal'}) threw exception Typ
eError: Failed to construct 'File': The "endings" property must be either "trans
parent" or "native".. |
96 PASS new File(throwingSequence, 'world.txt') threw exception Error: Misbehaving
property. | 105 PASS new File(throwingSequence, 'world.txt') threw exception Error: Misbehaving
property. |
97 PASS successfullyParsed is true | 106 PASS successfullyParsed is true |
98 | 107 |
99 TEST COMPLETE | 108 TEST COMPLETE |
100 | 109 |
OLD | NEW |