2 <script src=
"../../resources/js-test.js"></script>
3 <script src=
"resources/shared.js"></script>
6 description("Ensure IndexedDB transactions created before open onsuccess have correct metadata");
8 indexedDBTest(prepareDatabase
, onOpenSuccess
);
9 function prepareDatabase(evt
)
12 evalAndLog("db = event.target.result");
13 evalAndLog("store = db.createObjectStore('store')");
14 evalAndLog("store.createIndex('index', 'keyPath')");
15 evalAndLog("transaction = event.target.transaction");
16 shouldNotThrow("index = transaction.objectStore('store').index('index')");
17 transaction
.oncomplete
= onTransactionComplete
;
20 function onTransactionComplete(evt
)
23 debug("In multiprocess mode, 'complete' event may be dispatched before\n" +
24 "the 'success' arrives with updated metadata. Ensure the new metadata\n" +
25 "is still used for transactions.");
26 evalAndLog("store = db.transaction('store').objectStore('store')");
27 shouldNotThrow("index = store.index('index')");
30 function onOpenSuccess(evt
)
33 evalAndLog("db = event.target.result");
34 evalAndLog("store = db.transaction('store').objectStore('store')");
35 shouldNotThrow("index = store.index('index')");