haikuwebkit/LayoutTests/storage/indexeddb/mozilla/create-index-unique-private...

23 lines
782 B
Plaintext

Test IndexedDB's creating unique index and updating indexNames
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('a', { keyPath: 'id', autoIncrement: true });
index = objectStore.createIndex(indexName, indexKeyPath, { unique: true });
PASS index.name is indexName
PASS index.keyPath is indexKeyPath
PASS index.unique is true
PASS objectStore.indexNames.length is 1
PASS foundNewlyCreatedIndex is true
PASS event.target.transaction.db is db
PASS event.target.transaction.mode is 'versionchange'
PASS successfullyParsed is true
TEST COMPLETE