1 Test that data inserted into IndexedDB does not get corrupted on disk. 2 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 5 6 webkitIndexedDB.open('data-corruption') 7 openSuccess(): 8 db = event.target.result 9 db.setVersion('new version') 10 setVersionSuccess(): 11 trans = event.target.result 12 PASS trans !== null is true 13 Deleted all object stores. 14 db.createObjectStore('storeName') 15 addData(): 16 transaction = db.transaction([], webkitIDBTransaction.READ_WRITE) 17 request = transaction.objectStore('storeName').add({x: testDate}, 'key') 18 addData(): 19 transaction = db.transaction([], webkitIDBTransaction.READ_ONLY) 20 request = transaction.objectStore('storeName').get('key') 21 PASS event.target.result.x.toString() == testDate.toString() is true 22 PASS successfullyParsed is true 23 24 TEST COMPLETE 25 26