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