OLD | NEW |
1 Confirm that IndexedDB can store an empty File from the Filesystem API | 1 Confirm that IndexedDB can store an empty File from the Filesystem API |
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 Got FileSystem:file__0:Temporary | 6 Got FileSystem:file__0:Temporary |
7 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.
msIndexedDB || self.OIndexedDB; | |
8 | |
9 dbname = "empty-filesystem-file.html" | 7 dbname = "empty-filesystem-file.html" |
10 indexedDB.deleteDatabase(dbname) | 8 indexedDB.deleteDatabase(dbname) |
11 indexedDB.open(dbname) | 9 indexedDB.open(dbname) |
12 store = db.createObjectStore('storeName') | 10 store = db.createObjectStore('storeName') |
13 store.put('value', 'key') | 11 store.put('value', 'key') |
14 | 12 |
15 testEmptyFilesystemFile(): | 13 testEmptyFilesystemFile(): |
16 file = window.emptyFile | 14 file = window.emptyFile |
17 | 15 |
18 validateResult(file): | 16 validateResult(file): |
19 PASS file.size == 0 is true | 17 PASS file.size == 0 is true |
20 transaction = db.transaction('storeName', 'readwrite') | 18 transaction = db.transaction('storeName', 'readwrite') |
21 store = transaction.objectStore('storeName') | 19 store = transaction.objectStore('storeName') |
22 store.put(file, 'filekey') | 20 store.put(file, 'filekey') |
23 transaction = db.transaction('storeName', 'readwrite') | 21 transaction = db.transaction('storeName', 'readwrite') |
24 store = transaction.objectStore('storeName') | 22 store = transaction.objectStore('storeName') |
25 request = store.get('filekey') | 23 request = store.get('filekey') |
26 PASS event.target.result.size == 0 is true | 24 PASS event.target.result.size == 0 is true |
27 PASS successfullyParsed is true | 25 PASS successfullyParsed is true |
28 | 26 |
29 TEST COMPLETE | 27 TEST COMPLETE |
30 | 28 |
OLD | NEW |