| Test IndexedDB key comparison |
| |
| 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 |
| IDBCursor = window.IDBCursor || window.webkitIDBCursor; |
| PASS IDBCursor == null is false |
| IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange; |
| PASS IDBKeyRange == null is false |
| indexedDB.open(name, description) |
| db = event.target.result |
| request = db.setVersion('1') |
| Deleted all object stores. |
| db.createObjectStore('foo'); |
| date1 = new Date(1000); |
| request = objectStore.add([], date1); |
| date0 = new Date(0); |
| request = objectStore.add([], date0); |
| date3 = new Date(3000); |
| request = objectStore.add([], date3); |
| date2 = new Date(2000); |
| request = objectStore.add([], date2); |
| sortedKeys = [date0.toString(), date1.toString(), date2.toString(), date3.toString()]; |
| request = objectStore.openCursor(); |
| cursor = event.target.result; |
| PASS cursor.key.toString() is sortedKeys[keyIndex] |
| cursor.continue(); |
| keyIndex++; |
| cursor = event.target.result; |
| PASS cursor.key.toString() is sortedKeys[keyIndex] |
| cursor.continue(); |
| keyIndex++; |
| cursor = event.target.result; |
| PASS cursor.key.toString() is sortedKeys[keyIndex] |
| cursor.continue(); |
| keyIndex++; |
| cursor = event.target.result; |
| PASS cursor.key.toString() is sortedKeys[keyIndex] |
| cursor.continue(); |
| keyIndex++; |
| cursor = event.target.result; |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |