Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / storage / indexeddb / deletedatabase-transaction.html
blob67b4af607ddf233eecfa48ae0ef216ed9dadd72b
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <script src="resources/shared.js"></script>
4 <script>
5 description("Ensure deleteDatabase() can run concurrently with transactions in other databases");
7 indexedDBTest(prepareDatabase, startTransaction);
8 function prepareDatabase()
10 db = event.target.result;
11 evalAndLog("db.createObjectStore('store')");
14 function startTransaction() {
15 debug("");
16 debug("Start a transaction against the first database:");
17 evalAndLog("trans = db.transaction('store', 'readonly')");
18 evalAndLog("trans.objectStore('store').get(0)");
20 debug("");
21 debug("Delete a different database:");
22 evalAndLog("dbname2 = dbname + '2'");
23 request = evalAndLog("indexedDB.deleteDatabase(dbname2)");
24 request.onblocked = unexpectedBlockedCallback;
25 request.onerror = unexpectedErrorCallback;
26 request.onsuccess = function() {
27 testPassed("success event was fired at delete request");
30 trans.oncomplete = finishJSTest;
33 </script>