| Test IndexedDB: object identity |
| |
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| |
| |
| indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB; |
| |
| indexedDB.deleteDatabase(dbname) |
| indexedDB.open(dbname) |
| transaction = event.target.transaction; |
| objectStore1 = db.createObjectStore('foo'); |
| objectStore2 = transaction.objectStore('foo'); |
| PASS objectStore1 === objectStore2 is true |
| index1 = objectStore1.createIndex('bar', 'key'); |
| index2 = objectStore2.index('bar'); |
| PASS index1 === index2 is true |
| transaction = db.transaction('foo'); |
| objectStore3 = transaction.objectStore('foo'); |
| objectStore3.someProperty = 'xyz' |
| objectStore4 = transaction.objectStore('foo'); |
| PASS objectStore3 === objectStore4 is true |
| PASS objectStore4.someProperty is "xyz" |
| PASS objectStore3 === objectStore1 is false |
| PASS objectStore4 === objectStore2 is false |
| index3 = objectStore3.index('bar'); |
| index4 = objectStore4.index('bar'); |
| PASS index3 === index4 is true |
| PASS index3 === index1 is false |
| PASS index4 === index2 is false |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |