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

Side by Side Diff: LayoutTests/storage/indexeddb/empty-blob-file-expected.txt

Issue 433983002: LayoutTests for writing empty Blob/File/FileList to IndexedDB. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated test expectations to match ToT. Created 5 years, 9 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 Confirm that IndexedDB can store an empty Blob/File/FileList
2
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE ".
4
5
6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self. msIndexedDB || self.OIndexedDB;
7
8 dbname = "empty-blob-file.html"
9 indexedDB.deleteDatabase(dbname)
10 indexedDB.open(dbname)
11 store = db.createObjectStore('storeName')
12 store.put('value', 'key')
13
14 testEmptyBlob():
15 blob = new Blob([])
16
17 validateResult(blob):
18 PASS blob.size == 0 is true
19 transaction = db.transaction('storeName', 'readwrite')
20 store = transaction.objectStore('storeName')
21 store.put(blob, 'blobkey')
22 transaction = db.transaction('storeName', 'readwrite')
23 store = transaction.objectStore('storeName')
24 request = store.get('blobkey')
25 PASS event.target.result.size == 0 is true
26
27 testEmptyDataBlob():
28 blob = new Blob(['', '', ''])
29
30 validateResult(blob):
31 PASS blob.size == 0 is true
32 transaction = db.transaction('storeName', 'readwrite')
33 store = transaction.objectStore('storeName')
34 store.put(blob, 'blobkey')
35 transaction = db.transaction('storeName', 'readwrite')
36 store = transaction.objectStore('storeName')
37 request = store.get('blobkey')
38 PASS event.target.result.size == 0 is true
39
40 testEmptyNestedBlob():
41 blob = new Blob(['', new Blob([]), ''])
42
43 validateResult(blob):
44 PASS blob.size == 0 is true
45 transaction = db.transaction('storeName', 'readwrite')
46 store = transaction.objectStore('storeName')
47 store.put(blob, 'blobkey')
48 transaction = db.transaction('storeName', 'readwrite')
49 store = transaction.objectStore('storeName')
50 request = store.get('blobkey')
51 PASS event.target.result.size == 0 is true
52
53 testEmptyNestedDataBlob():
54 blob = new Blob(['', new Blob(['']), ''])
55
56 validateResult(blob):
57 PASS blob.size == 0 is true
58 transaction = db.transaction('storeName', 'readwrite')
59 store = transaction.objectStore('storeName')
60 store.put(blob, 'blobkey')
61 transaction = db.transaction('storeName', 'readwrite')
62 store = transaction.objectStore('storeName')
63 request = store.get('blobkey')
64 PASS event.target.result.size == 0 is true
65
66 testEmptyFileInsideBlob():
67 file = emptyFileInput.files[0]
68 blob = new Blob(['', file, ''])
69
70 validateResult(blob):
71 PASS blob.size == 0 is true
72 transaction = db.transaction('storeName', 'readwrite')
73 store = transaction.objectStore('storeName')
74 store.put(blob, 'blobkey')
75 transaction = db.transaction('storeName', 'readwrite')
76 store = transaction.objectStore('storeName')
77 request = store.get('blobkey')
78 PASS event.target.result.size == 0 is true
79
80 testEmptyFileInsideNestedBlob():
81 file = emptyFileInput.files[0]
82 blob = new Blob(['', new Blob([file]), ''])
83
84 validateResult(blob):
85 PASS blob.size == 0 is true
86 transaction = db.transaction('storeName', 'readwrite')
87 store = transaction.objectStore('storeName')
88 store.put(blob, 'blobkey')
89 transaction = db.transaction('storeName', 'readwrite')
90 store = transaction.objectStore('storeName')
91 request = store.get('blobkey')
92 PASS event.target.result.size == 0 is true
93
94 testEmptyFile():
95 file = emptyFileInput.files[0]
96
97 validateResult(file):
98 PASS file.size == 0 is true
99 transaction = db.transaction('storeName', 'readwrite')
100 store = transaction.objectStore('storeName')
101 store.put(file, 'filekey')
102 transaction = db.transaction('storeName', 'readwrite')
103 store = transaction.objectStore('storeName')
104 request = store.get('filekey')
105 PASS event.target.result.size == 0 is true
106
107 testEmptyFileList():
108 fileList = emptyFileListInput.files
109
110 validateResult(fileList):
111 PASS fileList.length == 0 is true
112 transaction = db.transaction('storeName', 'readwrite')
113 store = transaction.objectStore('storeName')
114 store.put(fileList, 'fileListkey')
115 transaction = db.transaction('storeName', 'readwrite')
116 store = transaction.objectStore('storeName')
117 request = store.get('fileListkey')
118 PASS event.target.result.length == 0 is true
119 PASS successfullyParsed is true
120
121 TEST COMPLETE
122
OLDNEW
« no previous file with comments | « LayoutTests/storage/indexeddb/empty-blob-file.html ('k') | LayoutTests/storage/indexeddb/empty-filesystem-file.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698