| Test IndexedDB's creating index with integer keys |
| |
| 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('foo', { keyPath: 'id' }); |
| data = { id: 16, num: 42 }; |
| objectStore.add(data); |
| index = objectStore.createIndex('foo', 'num'); |
| result = index.openKeyCursor(); |
| cursor = event.target.result; |
| PASS cursor == null is false |
| PASS cursor.key is data.num |
| PASS cursor.primaryKey is data.id |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |