OLD | NEW |
(Empty) | |
| 1 read-only transaction should see the result of a previous readwrite transaction |
| 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 = "transaction-coordination-ro-waits-for-rw.html" |
| 9 indexedDB.deleteDatabase(dbname) |
| 10 indexedDB.open(dbname) |
| 11 |
| 12 prepareDatabase(): |
| 13 db = event.target.result |
| 14 store = db.createObjectStore('store') |
| 15 store.put('original value', 'key') |
| 16 |
| 17 runTransactions(): |
| 18 db = event.target.result |
| 19 transaction1 = db.transaction('store', 'readwrite') |
| 20 transaction2 = db.transaction('store', 'readonly') |
| 21 request = transaction1.objectStore('store').put('new value', 'key') |
| 22 request2 = transaction2.objectStore('store').get('key') |
| 23 |
| 24 checkResult(): |
| 25 PASS request2.result is "new value" |
| 26 PASS successfullyParsed is true |
| 27 |
| 28 TEST COMPLETE |
| 29 |
OLD | NEW |