blob: ec644d8a7e7f6416e20bb424f5b648e6b796c76e [file] [log] [blame]
Verify that you can put the same data in 2 different databases without uniqueness constraints firing.
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)
db.createObjectStore('storeName', null)
store.createIndex('indexName', 'x')
store.add({x: 'value', y: 'zzz'}, 'key')
event.target.source.add({x: 'value2', y: 'zzz2'}, 'key2')
indexObject.getKey('value')
PASS event.target.result is "key"
indexObject.get('value')
PASS event.target.result.x is "value"
PASS event.target.result.y is "zzz"
indexObject.getKey('does not exist')
PASS event.target.result is undefined
indexObject.get('does not exist')
PASS event.target.result is undefined
indexObject.openKeyCursor()
PASS event.target.result is non-null.
PASS event.target.result.key is "value"
PASS event.target.result.primaryKey is "key"
event.target.result.continue()
PASS event.target.result is non-null.
PASS event.target.result.key is "value2"
PASS event.target.result.primaryKey is "key2"
event.target.result.continue()
PASS event.target.result is null
indexObject.openCursor()
PASS event.target.result is non-null.
PASS event.target.result.key is "value"
PASS event.target.result.value.x is "value"
PASS event.target.result.value.y is "zzz"
event.target.result.continue()
PASS event.target.result is non-null.
PASS event.target.result.key is "value2"
PASS event.target.result.value.x is "value2"
PASS event.target.result.value.y is "zzz2"
event.target.result.continue()
PASS event.target.result is null
indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname)
db.createObjectStore('storeName', null)
store.createIndex('indexName', 'x')
store.add({x: 'value', y: 'zzz'}, 'key')
event.target.source.add({x: 'value2', y: 'zzz2'}, 'key2')
indexObject.getKey('value')
PASS event.target.result is "key"
indexObject.get('value')
PASS event.target.result.x is "value"
PASS event.target.result.y is "zzz"
indexObject.getKey('does not exist')
PASS event.target.result is undefined
indexObject.get('does not exist')
PASS event.target.result is undefined
indexObject.openKeyCursor()
PASS event.target.result is non-null.
PASS event.target.result.key is "value"
PASS event.target.result.primaryKey is "key"
event.target.result.continue()
PASS event.target.result is non-null.
PASS event.target.result.key is "value2"
PASS event.target.result.primaryKey is "key2"
event.target.result.continue()
PASS event.target.result is null
indexObject.openCursor()
PASS event.target.result is non-null.
PASS event.target.result.key is "value"
PASS event.target.result.value.x is "value"
PASS event.target.result.value.y is "zzz"
event.target.result.continue()
PASS event.target.result is non-null.
PASS event.target.result.key is "value2"
PASS event.target.result.value.x is "value2"
PASS event.target.result.value.y is "zzz2"
event.target.result.continue()
PASS event.target.result is null
PASS successfullyParsed is true
TEST COMPLETE