blob: 3b23fc97d576fb87d6a1778f03bec15644177ce1 [file] [log] [blame]
Test IndexedDB's creating index with integer keys
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)
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