3 <script src=
"../../resources/js-test.js"></script>
4 <script src=
"resources/shared.js"></script>
16 var body
= document
.getElementsByTagName("iframe")[0].contentDocument
.body
;
18 description("Test that pending transactions are not completed during recursive JS calls until all JS (in all frames) is finished.");
20 indexedDBTest(prepareDatabase
, click
);
21 function prepareDatabase()
23 db
= event
.target
.result
;
24 store
= db
.createObjectStore('objectStore', null);
29 var pendingTransaction
= evalAndLog("pendingTransaction = db.transaction(['objectStore'], 'readwrite')");
30 pendingTransaction
.onerror
= unexpectedErrorCallback
;
31 pendingTransaction
.onabort
= unexpectedAbortCallback
;
32 pendingTransaction
.oncomplete
= completeCallback
;
33 var event
= document
.createEvent("MouseEvent");
34 event
.initMouseEvent("click", true, true, document
.defaultView
, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
35 body
.dispatchEvent(event
);
36 var store
= evalAndLog("store = pendingTransaction.objectStore('objectStore')");
37 shouldBeTrue("store !== undefined");
38 body
.onclick
= undefined;
43 debug("Start re-entrant JS");
44 transaction
= evalAndLog("transaction = db.transaction(['objectStore'], 'readwrite')");
45 debug("End re-entrant JS");
49 function completeCallback()
51 debug("Pending transaction completed");