blob: e3a63ecdf5d2c18d225d2e9efaf404ae40a13e6e [file] [log] [blame]
Test IndexedDB adding an autoincremented key and retrieving it successfully
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)
test = {
name: 'inline key; key generator',
autoIncrement: true,
storedObject: { name: 'Lincoln' },
keyName: 'id',
};
objectStore = db.createObjectStore(test.name, { keyPath: test.keyName, autoIncrement: test.autoIncrement });
request = objectStore.add(test.storedObject);
id = event.target.result;
request = objectStore.get(id);
PASS event.target.result.name is test.storedObject.name
PASS event.target.result.id is id
PASS successfullyParsed is true
TEST COMPLETE