OLD | NEW |
1 Test that data inserted into IndexedDB does not get corrupted on disk. | 1 Test that data inserted into IndexedDB does not get corrupted on disk. |
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 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.
msIndexedDB || self.OIndexedDB; | 6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.
msIndexedDB || self.OIndexedDB; |
7 | 7 |
8 dbname = "data-corruption.html" | 8 dbname = "data-corruption.html" |
9 indexedDB.deleteDatabase(dbname) | 9 indexedDB.deleteDatabase(dbname) |
10 indexedDB.open(dbname) | 10 indexedDB.open(dbname) |
11 setVersionSuccess(): | 11 setVersionSuccess(): |
| 12 PASS event.dataLoss is "none" |
12 trans = event.target.transaction | 13 trans = event.target.transaction |
13 PASS trans is non-null. | 14 PASS trans is non-null. |
14 db.createObjectStore('storeName') | 15 db.createObjectStore('storeName') |
15 addData(): | 16 addData(): |
16 transaction = db.transaction(['storeName'], 'readwrite') | 17 transaction = db.transaction(['storeName'], 'readwrite') |
17 request = transaction.objectStore('storeName').add({x: testDate}, 'key') | 18 request = transaction.objectStore('storeName').add({x: testDate}, 'key') |
18 addData(): | 19 addData(): |
19 transaction = db.transaction(['storeName'], 'readonly') | 20 transaction = db.transaction(['storeName'], 'readonly') |
20 request = transaction.objectStore('storeName').get('key') | 21 request = transaction.objectStore('storeName').get('key') |
21 PASS event.target.result.x.toString() is testDate.toString() | 22 PASS event.target.result.x.toString() is testDate.toString() |
22 PASS successfullyParsed is true | 23 PASS successfullyParsed is true |
23 | 24 |
24 TEST COMPLETE | 25 TEST COMPLETE |
25 | 26 |
OLD | NEW |