blob: c01f643cbb7222e0b8065b71831acd9dba3d0b98 [file] [log] [blame]
if (this.importScripts) {
importScripts('../../../resources/js-test.js');
importScripts('shared.js');
}
description("Ensure deleteDatabase() can run concurrently with transactions in other databases");
indexedDBTest(prepareDatabase, startTransaction);
function prepareDatabase()
{
db = event.target.result;
evalAndLog("db.createObjectStore('store')");
}
function startTransaction() {
debug("");
debug("Start a transaction against the first database:");
evalAndLog("trans = db.transaction('store', 'readonly')");
evalAndLog("trans.objectStore('store').get(0)");
debug("");
debug("Delete a different database:");
evalAndLog("dbname2 = dbname + '2'");
request = evalAndLog("indexedDB.deleteDatabase(dbname2)");
request.onblocked = unexpectedBlockedCallback;
request.onerror = unexpectedErrorCallback;
request.onsuccess = function() {
testPassed("success event was fired at delete request");
};
trans.oncomplete = finishJSTest;
}