Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1485)

Side by Side Diff: third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/files/file-constructor-expected.txt

Issue 1526183004: Prevent SharedArrayBuffer views from being used in bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: some tests Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 Test the File constructor.
2
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE ".
4
5
6 PASS (new File([], '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
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
11 PASS (new File(['hello'], 'world.html', {type:'text/html', endings:'transparent' })) instanceof window.File is true
12 PASS (new File([], 'world.html')) instanceof window.File is true
13 PASS (new File()) threw exception TypeError: Failed to construct 'File': 2 argum ents required, but only 0 present..
14 PASS (new File([])) threw exception TypeError: Failed to construct 'File': 2 arg uments required, but only 1 present..
15 PASS (new File([], null)) instanceof window.File is true
16 PASS (new File([], 1)) instanceof window.File is true
17 PASS (new File([], '')) instanceof window.File is true
18 PASS (new File([], document)) instanceof window.File is true
19 PASS new File('hello', 'world.html') threw exception TypeError: Failed to constr uct 'File': The 1st argument is neither an array, nor does it have indexed prope rties..
20 PASS new File(0, 'world.html') threw exception TypeError: Failed to construct 'F ile': The 1st argument is neither an array, nor does it have indexed properties. .
21 PASS new File(null, 'world.html') threw exception TypeError: Failed to construct 'File': The 1st argument is neither an array, nor does it have indexed properti es..
22 PASS (new File([], 'world.html')) instanceof window.File is true
23 PASS (new File(['stringPrimitive'], 'world.html')) instanceof window.File is tru e
24 PASS (new File([String('stringObject')], 'world.html')) instanceof window.File i s true
25 PASS (new File([new Blob], 'world.html')) instanceof window.File is true
26 PASS (new File([new Blob([new Blob])], 'world.html')) instanceof window.File is true
27 PASS (new Blob([new File([], 'world.txt')])) instanceof window.Blob is true
28 PASS (new Blob([new Blob([new File([new Blob], 'world.txt')])])) instanceof wind ow.Blob is true
29 PASS (new File([new File([], 'world.txt')], 'world.html')) instanceof window.Fil e is true
30 PASS (new File([new Blob([new File([new Blob], 'world.txt')])], 'world.html')) i nstanceof window.File is true
31 PASS (new File([12], 'world.html')).size is 2
32 PASS (new File([[]], 'world.html')).size is 0
33 PASS (new File([{}], 'world.html')).size is 15
34 PASS (new File([document], 'world.html')).size is 21
35 PASS (new File([toStringingObj], 'world.html')).size is 8
36 PASS new File([throwingObj], 'world.html') threw exception Error.
37 PASS (new File([], null)).name is 'null'
38 PASS (new File([], 12)).name is '12'
39 PASS (new File([], '')).name is ''
40 PASS (new File([], {})).name is '[object Object]'
41 PASS (new File([], document)).name is '[object HTMLDocument]'
42 PASS (new File([], toStringingObj)).name is 'A string'
43 PASS (new File([], throwingObj)).name threw exception Error.
44 PASS (new File([], 'world.html', {unknownKey:'value'})) instanceof window.File i s true
45 PASS new File([], 'world.html', {endings:'illegalValue'}) threw exception TypeEr ror: Failed to construct 'File': The provided value 'illegalValue' is not a vali d enum value of type NormalizeLineEndings..
46 PASS new File([], 'world.html', {endings:throwingObj}) threw exception Error.
47 PASS new File([], 'world.html', {type:throwingObj}) threw exception Error.
48 PASS new File([], 'world.html', {type:'helloĆ®'}) threw exception SyntaxError: Fa iled to construct 'File': The 'type' property must consist of ASCII characters..
49 PASS (new File([], 'world.html', null)) instanceof window.File is true
50 PASS (new File([], 'world.html', undefined)) instanceof window.File is true
51 PASS (new File([], 'world.html', 123)) instanceof window.File threw exception Ty peError: Failed to construct 'File': parameter 3 ('options') is not an object..
52 PASS (new File([], 'world.html', 123.4)) instanceof window.File threw exception TypeError: Failed to construct 'File': parameter 3 ('options') is not an object. .
53 PASS (new File([], 'world.html', true)) instanceof window.File threw exception T ypeError: Failed to construct 'File': parameter 3 ('options') is not an object..
54 PASS (new File([], 'world.html', 'abc')) instanceof window.File threw exception TypeError: Failed to construct 'File': parameter 3 ('options') is not an object. .
55 PASS (new File([], 'world.html', [])) instanceof window.File is true
56 PASS (new File([], 'world.html', /abc/)) instanceof window.File is true
57 PASS (new File([], 'world.html', function () {})) instanceof window.File is true
58 PASS (new File([], 'world.html', {type:'text/html'})).name is 'world.html'
59 PASS (new File([], 'world.html', {type:'text/html'})).type is 'text/html'
60 PASS (new File([], 'world.html', {type:'text/html'})).size is 0
61 PASS (new File([], 'world.html', {type:'text/plain;charset=UTF-8'})).type is 'te xt/plain;charset=utf-8'
62 PASS (new File([], 'world.html', {lastModified: 441532800000})).lastModified is 441532800000
63 PASS (new File([], 'world.html')).lastModified is equivalent to Date.now().
64 PASS (new File([], 'world.html', {})).lastModified is equivalent to Date.now().
65 PASS (new File([], 'world.html', {type: 'text/plain'})).lastModified is equivale nt to Date.now().
66 PASS (new File([], 'world.html', {lastModified: new Date(441532800000)})).lastMo dified is 441532800000
67 PASS (new File([], 'world.html', {lastModified: 441532800000})).lastModifiedDate instanceof Date is true
68 PASS (new File([], 'world.html', {lastModified: 441532800000})).lastModifiedDate .valueOf() is 441532800000
69 PASS window.File.length is 2
70 PASS new File([new DataView(new ArrayBuffer(100))], 'world.html').size is 100
71 PASS new File([new Uint8Array(100)], 'world.html').size is 100
72 PASS new File([new Uint8ClampedArray(100)], 'world.html').size is 100
73 PASS new File([new Uint16Array(100)], 'world.html').size is 200
74 PASS new File([new Uint32Array(100)], 'world.html').size is 400
75 PASS new File([new Int8Array(100)], 'world.html').size is 100
76 PASS new File([new Int16Array(100)], 'world.html').size is 200
77 PASS new File([new Int32Array(100)], 'world.html').size is 400
78 PASS new File([new Float32Array(100)], 'world.html').size is 400
79 PASS new File([new Float64Array(100)], 'world.html').size is 800
80 PASS new File([new Float64Array(100), new Int32Array(100), new Uint8Array(100), new DataView(new ArrayBuffer(100))], 'world.html').size is 1400
81 PASS new File([new Blob([new Int32Array(100)]), new Uint8Array(100), new Float32 Array(100), new DataView(new ArrayBuffer(100))], 'world.html').size is 1000
82 PASS new File([new Blob([new Int32Array(100)]), new File([new Uint16Array(100)], 'world.txt'), new Uint8Array(100), new Float32Array(100), new DataView(new Arra yBuffer(100))], 'world.html').size is 1200
83 PASS new File([new Uint8Array(new SharedArrayBuffer(100))], 'world.html') threw exception TypeError: Failed to construct 'File': sequence parameter 1 contains a view of a SharedArrayBuffer..
84 PASS new File([new Uint8ClampedArray(new SharedArrayBuffer(100))], 'world.html') threw exception TypeError: Failed to construct 'File': sequence parameter 1 con tains a view of a SharedArrayBuffer..
85 PASS new File([new Uint16Array(new SharedArrayBuffer(100))], 'world.html') threw exception TypeError: Failed to construct 'File': sequence parameter 1 contains a view of a SharedArrayBuffer..
86 PASS new File([new Uint32Array(new SharedArrayBuffer(100))], 'world.html') threw exception TypeError: Failed to construct 'File': sequence parameter 1 contains a view of a SharedArrayBuffer..
87 PASS new File([new Int8Array(new SharedArrayBuffer(100))], 'world.html') threw e xception TypeError: Failed to construct 'File': sequence parameter 1 contains a view of a SharedArrayBuffer..
88 PASS new File([new Int16Array(new SharedArrayBuffer(100))], 'world.html') threw exception TypeError: Failed to construct 'File': sequence parameter 1 contains a view of a SharedArrayBuffer..
89 PASS new File([new Int32Array(new SharedArrayBuffer(100))], 'world.html') threw exception TypeError: Failed to construct 'File': sequence parameter 1 contains a view of a SharedArrayBuffer..
90 PASS new File([new Float32Array(new SharedArrayBuffer(100))], 'world.html') thre w exception TypeError: Failed to construct 'File': sequence parameter 1 contains a view of a SharedArrayBuffer..
91 PASS new File([new Float64Array(new SharedArrayBuffer(104))], 'world.html') thre w exception TypeError: Failed to construct 'File': sequence parameter 1 contains a view of a SharedArrayBuffer..
92 PASS new File([(new DataView(new ArrayBuffer(100))).buffer], 'world.html').size is 100
93 PASS new File([(new Uint8Array(100)).buffer], 'world.html').size is 100
94 PASS new File([(new Uint8ClampedArray(100)).buffer], 'world.html').size is 100
95 PASS new File([(new Uint16Array(100)).buffer], 'world.html').size is 200
96 PASS new File([(new Uint32Array(100)).buffer], 'world.html').size is 400
97 PASS new File([(new Int8Array(100)).buffer], 'world.html').size is 100
98 PASS new File([(new Int16Array(100)).buffer], 'world.html').size is 200
99 PASS new File([(new Int32Array(100)).buffer], 'world.html').size is 400
100 PASS new File([(new Float32Array(100)).buffer], 'world.html').size is 400
101 PASS new File([(new Float64Array(100)).buffer], 'world.html').size is 800
102 PASS new File([(new Float64Array(100)).buffer, (new Int32Array(100)).buffer, (ne w Uint8Array(100)).buffer, (new DataView(new ArrayBuffer(100))).buffer], 'world. html').size is 1400
103 PASS new File([new Blob([(new Int32Array(100)).buffer]), (new Uint8Array(100)).b uffer, (new Float32Array(100)).buffer, (new DataView(new ArrayBuffer(100))).buff er], 'world.html').size is 1000
104 PASS new File([new Blob([(new Int32Array(100)).buffer]), new File([new Uint16Arr ay(100).buffer], 'world.txt'), (new Uint8Array(100)).buffer, (new Float32Array(1 00)).buffer, (new DataView(new ArrayBuffer(100))).buffer], 'world.html').size is 1200
105 PASS new Blob([new Blob([new Int32Array(100)]), new File([new Uint16Array(100)], 'world.txt'), new Uint8Array(100), new Float32Array(100), new DataView(new Arra yBuffer(100))]).size is 1200
106 PASS new Blob([new Blob([(new Int32Array(100)).buffer]), new File([new Uint16Arr ay(100).buffer], 'world.txt'), (new Uint8Array(100)).buffer, (new Float32Array(1 00)).buffer, (new DataView(new ArrayBuffer(100))).buffer]).size is 1200
107 PASS new File({length: 0}, 'world.txt').size is 0
108 PASS new File({length: 1, 0: 'string'}, 'world.txt').size is 6
109 PASS successfullyParsed is true
110
111 TEST COMPLETE
112
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698