blob: f66f266d259b357760397b6f1018df932cb437a0 [file] [log] [blame]
Regression test for WK82678 - don't commit after a blocked event
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
dbname = "dont-commit-on-blocked.html"
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname)
db.onversionchange = onVersionChange
store = db.createObjectStore('store1')
holdConnection():
holding connection until versionchange event
Starting worker: resources/dont-commit-on-blocked-worker.js
[Worker] indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
[Worker]
[Worker] opening database connection
[Worker] request = indexedDB.open('dont-commit-on-blocked.html', 2)
[Worker] state = 'setversion'
[Worker] request.onblocked = onSetVersionBlocked
[Worker] request.onupgradeneeded = onSetVersionSuccess
[Worker] spinning for 100ms to let events be queued but prevent dispatch
[Worker] done spinning
[Worker]
[Worker] onSetVersionBlocked():
PASS [Worker] state is "setversion"
[Worker] state = 'blocked'
[Worker]
[Worker] onSetVersionSuccess():
[Worker] db = event.target.result
PASS [Worker] state is "blocked"
[Worker] state = 'success'
[Worker] creating object store - will fail if transaction commited after blocked event
[Worker] db.createObjectStore('store2')
[Worker]
[Worker] onTransactionComplete
PASS [Worker] state is "success"
PASS [Worker] Number(db.version) is 2
PASS [Worker] db.objectStoreNames.contains('store1') is true
PASS [Worker] db.objectStoreNames.contains('store2') is true
PASS successfullyParsed is true
TEST COMPLETE