| Test IndexedDB's read/write transactions |
| |
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| |
| |
| indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB; |
| PASS indexedDB == null is false |
| IDBDatabaseException = window.IDBDatabaseException || window.webkitIDBDatabaseException; |
| PASS IDBDatabaseException == null is false |
| IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction; |
| PASS IDBTransaction == null is false |
| indexedDB.open(name, description) |
| db = event.target.result |
| request = db.setVersion('1') |
| Deleted all object stores. |
| objectStore = db.createObjectStore(osName, { autoIncrement: true }); |
| request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).add({}); |
| PASS event.target.transaction.mode is IDBTransaction.READ_WRITE |
| key1 = event.target.result; |
| request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).add({}); |
| PASS event.target.transaction.mode is IDBTransaction.READ_WRITE |
| key2 = event.target.result; |
| request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).put({}, key1); |
| PASS event.target.transaction.mode is IDBTransaction.READ_WRITE |
| request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).put({}, key2); |
| PASS event.target.transaction.mode is IDBTransaction.READ_WRITE |
| request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).put({}, key1); |
| PASS event.target.transaction.mode is IDBTransaction.READ_WRITE |
| request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).put({}, key1); |
| PASS event.target.transaction.mode is IDBTransaction.READ_WRITE |
| request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).delete(key1); |
| PASS event.target.transaction.mode is IDBTransaction.READ_WRITE |
| request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).delete(key2); |
| PASS event.target.transaction.mode is IDBTransaction.READ_WRITE |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |