IndexedDBFactory now ForceCloses databases.
[chromium-blink-merge.git] / content / test / data / indexeddb / transaction_not_blocked.js
blob3a22ba6da61072ccd78f9acf399b5ad5ee99749c
1 // Copyright (c) 2013 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.
5 function test()
7 // Do not use indexedDBTest() - need to re-use previous database.
8 var dbname = "doesnt-hang-test";
9 var request = indexedDB.open(dbname);
10 request.onerror = unexpectedErrorCallback;
11 request.onblocked = unexpectedBlockedCallback;
12 request.onupgradeneeded = unexpectedUpgradeNeededCallback;
13 request.onsuccess = onOpenSuccess;
16 function onOpenSuccess()
18 var db = event.target.result;
20 debug('Creating new transaction.');
21 var transaction = db.transaction('store', 'readwrite');
22 transaction.onabort = unexpectedAbortCallback;
23 var objectStore = transaction.objectStore('store');
25 var request = objectStore.get(0);
26 request.onerror = unexpectedErrorCallback;
27 request.onsuccess = function() {
28 debug("request completed successfully");
31 transaction.oncomplete = function() {
32 debug("transaction completed");
33 done();