Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / storage / indexeddb / empty-blob-file-expected.txt
blob1bde8d64c2f0dabd0c0100e6eb942a59cd01b5a9
1 Confirm that IndexedDB can store an empty Blob/File/FileList
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "empty-blob-file.html"
7 indexedDB.deleteDatabase(dbname)
8 indexedDB.open(dbname)
9 store = db.createObjectStore('storeName')
10 store.put('value', 'key')
12 testEmptyBlob():
13 blob = new Blob([])
15 validateResult(blob):
16 PASS blob.size == 0 is true
17 transaction = db.transaction('storeName', 'readwrite')
18 store = transaction.objectStore('storeName')
19 store.put(blob, 'blobkey')
20 transaction = db.transaction('storeName', 'readwrite')
21 store = transaction.objectStore('storeName')
22 request = store.get('blobkey')
23 PASS event.target.result.size == 0 is true
25 testEmptyDataBlob():
26 blob = new Blob(['', '', ''])
28 validateResult(blob):
29 PASS blob.size == 0 is true
30 transaction = db.transaction('storeName', 'readwrite')
31 store = transaction.objectStore('storeName')
32 store.put(blob, 'blobkey')
33 transaction = db.transaction('storeName', 'readwrite')
34 store = transaction.objectStore('storeName')
35 request = store.get('blobkey')
36 PASS event.target.result.size == 0 is true
38 testEmptyNestedBlob():
39 blob = new Blob(['', new Blob([]), ''])
41 validateResult(blob):
42 PASS blob.size == 0 is true
43 transaction = db.transaction('storeName', 'readwrite')
44 store = transaction.objectStore('storeName')
45 store.put(blob, 'blobkey')
46 transaction = db.transaction('storeName', 'readwrite')
47 store = transaction.objectStore('storeName')
48 request = store.get('blobkey')
49 PASS event.target.result.size == 0 is true
51 testEmptyNestedDataBlob():
52 blob = new Blob(['', new Blob(['']), ''])
54 validateResult(blob):
55 PASS blob.size == 0 is true
56 transaction = db.transaction('storeName', 'readwrite')
57 store = transaction.objectStore('storeName')
58 store.put(blob, 'blobkey')
59 transaction = db.transaction('storeName', 'readwrite')
60 store = transaction.objectStore('storeName')
61 request = store.get('blobkey')
62 PASS event.target.result.size == 0 is true
64 testEmptyFileInsideBlob():
65 file = emptyFileInput.files[0]
66 blob = new Blob(['', file, ''])
68 validateResult(blob):
69 PASS blob.size == 0 is true
70 transaction = db.transaction('storeName', 'readwrite')
71 store = transaction.objectStore('storeName')
72 store.put(blob, 'blobkey')
73 transaction = db.transaction('storeName', 'readwrite')
74 store = transaction.objectStore('storeName')
75 request = store.get('blobkey')
76 PASS event.target.result.size == 0 is true
78 testEmptyFileInsideNestedBlob():
79 file = emptyFileInput.files[0]
80 blob = new Blob(['', new Blob([file]), ''])
82 validateResult(blob):
83 PASS blob.size == 0 is true
84 transaction = db.transaction('storeName', 'readwrite')
85 store = transaction.objectStore('storeName')
86 store.put(blob, 'blobkey')
87 transaction = db.transaction('storeName', 'readwrite')
88 store = transaction.objectStore('storeName')
89 request = store.get('blobkey')
90 PASS event.target.result.size == 0 is true
92 testEmptyFile():
93 file = emptyFileInput.files[0]
95 validateResult(file):
96 PASS file.size == 0 is true
97 transaction = db.transaction('storeName', 'readwrite')
98 store = transaction.objectStore('storeName')
99 store.put(file, 'filekey')
100 transaction = db.transaction('storeName', 'readwrite')
101 store = transaction.objectStore('storeName')
102 request = store.get('filekey')
103 PASS event.target.result.size == 0 is true
105 testEmptyFileList():
106 fileList = emptyFileListInput.files
108 validateResult(fileList):
109 PASS fileList.length == 0 is true
110 transaction = db.transaction('storeName', 'readwrite')
111 store = transaction.objectStore('storeName')
112 store.put(fileList, 'fileListkey')
113 transaction = db.transaction('storeName', 'readwrite')
114 store = transaction.objectStore('storeName')
115 request = store.get('fileListkey')
116 PASS event.target.result.length == 0 is true
117 PASS successfullyParsed is true
119 TEST COMPLETE