1 Test IndexedDB deleteIndex method
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "deleteIndex.html"
7 indexedDB.deleteDatabase(dbname)
9 objectStore = db.createObjectStore('foo');
10 Expecting exception from objectStore.deleteIndex('first')
11 PASS Exception was thrown.
12 PASS code is DOMException.NOT_FOUND_ERR
13 PASS ename is 'NotFoundError'
14 Exception message: Failed to execute 'deleteIndex' on 'IDBObjectStore': The specified index was not found.
15 PASS objectStore.deleteIndex() threw exception TypeError: Failed to execute 'deleteIndex' on 'IDBObjectStore': 1 argument required, but only 0 present..
16 index = objectStore.createIndex('first', 'first');
17 Expecting exception from objectStore.deleteIndex('FIRST')
18 PASS Exception was thrown.
19 PASS code is DOMException.NOT_FOUND_ERR
20 PASS ename is 'NotFoundError'
21 Exception message: Failed to execute 'deleteIndex' on 'IDBObjectStore': The specified index was not found.
22 index = objectStore.createIndex('second', 'second');
23 returnValue = objectStore.deleteIndex('first');
24 PASS returnValue is undefined
25 Expecting exception from db.createObjectStore('bar');
26 PASS Exception was thrown.
27 PASS code is DOMException.INVALID_STATE_ERR
28 PASS ename is 'InvalidStateError'
29 Exception message: Failed to execute 'createObjectStore' on 'IDBDatabase': The database is not running a version change transaction.
30 Expecting exception from objectStore.deleteIndex('second')
31 PASS Exception was thrown.
33 PASS ename is 'TransactionInactiveError'
34 Exception message: Failed to execute 'deleteIndex' on 'IDBObjectStore': The transaction has finished.
35 PASS successfullyParsed is true