2 <script src=
"../../resources/js-test.js"></script>
3 <script src=
"resources/shared.js"></script>
6 description("Ensure IndexedDB's IDBObjectStore.deleteIndex() works if IDBIndex object has not been fetched - regression test for bug 110792.");
8 indexedDBTest(onFirstUpgradeNeeded
, closeAndReOpen
, {version
: 1});
10 function onFirstUpgradeNeeded(evt
)
13 evalAndLog("db = event.target.result");
14 evalAndLog("store = db.createObjectStore('store')");
15 evalAndLog("store.createIndex('index', 'keyPath')");
18 function closeAndReOpen()
21 evalAndLog("db.close()");
23 request
= evalAndLog("indexedDB.open(dbname, 2)");
24 request
.onblocked
= unexpectedBlockedCallback
;
25 request
.onerror
= unexpectedErrorCallback
;
26 request
.onupgradeneeded
= onSecondUpgradeNeeded
;
27 request
.onsuccess
= finishJSTest
;
30 function onSecondUpgradeNeeded(evt
)
33 evalAndLog("db = event.target.result");
34 evalAndLog("store = event.target.transaction.objectStore('store')");
35 // Do NOT add a call to store.index('index') here (e.g. to assert it exists)
36 // or the bug disappears.
37 evalAndLog("store.deleteIndex('index')");
38 evalAndExpectException("store.index('index')", "DOMException.NOT_FOUND_ERR", "'NotFoundError'");