1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 var dbbase = "callback_accounting_";
9 var request1 = indexedDB.open(dbbase + 1);
11 request1.onupgradeneeded = function() {
12 debug("request1 open onupgradeneeded");
13 request1.result.createObjectStore('store');
16 request1.onsuccess = function() {
17 debug("request1 open onsuccess");
19 var db1 = request1.result;
20 var transaction = db1.transaction('store');
21 transaction.onabort = unexpectedAbortCallback;
23 debug("transaction created and looping");
24 endTransaction = false;
25 transactionRunning = true;
27 if (!endTransaction) {
28 transaction.objectStore('store').get(0).onsuccess = loop;
33 var request2 = indexedDB.open(dbbase + 2);
35 request2.onsuccess = function() {
36 debug("request2 open onsuccess");
38 shouldBeTrue("transactionRunning");
39 var db2 = request2.result;
42 endTransaction = true;
43 debug("ending transaction");
46 transaction.oncomplete = function() {
47 debug("transaction oncomplete");
48 shouldBeTrue("endTransaction");