blob: 2bdd053913e12b16ea2125712bfa9dd782c975a9 [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".
dbname = "create-index-with-integer-keys.html"
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