1Test the basics of IndexedDB's webkitIDBIndex. 2 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 5 6webkitIndexedDB.open('index-basics') 7db = event.target.result 8db.setVersion('new version') 9setVersionSuccess(): 10trans = event.target.result 11PASS trans !== null is true 12Deleted all object stores. 13db.createObjectStore('storeName', null) 14store.createIndex('indexName', 'x') 15store.createIndex('indexName2', 'y', false) 16store.createIndex('zIndex', 'z', true) 17PASS 'name' in indexObject is true 18PASS indexObject.name is "indexName" 19PASS 'objectStore' in indexObject is true 20PASS indexObject.objectStore.name is "storeName" 21PASS 'keyPath' in indexObject is true 22PASS indexObject.keyPath is "x" 23PASS 'unique' in indexObject is true 24PASS indexObject.unique is false 25PASS 'openKeyCursor' in indexObject is true 26PASS 'openCursor' in indexObject is true 27PASS 'getKey' in indexObject is true 28PASS 'get' in indexObject is true 29store.add({x: 'value', y: 'zzz', z: 2.72}, 'key') 30event.target.source.add({x: 'value2', y: 'zzz2', z: 2.71, foobar: 12}, 'key2') 31store.createIndex('indexWhileAddIsInFlight', 'x') 32store.createIndex('indexWithWeirdKeyPath', 'foobar') 33indexObject.getKey('value') 34PASS event.target.result is "key" 35indexObject2.getKey('zzz') 36PASS event.target.result is "key" 37indexObject3.get(2.71) 38PASS event.target.result.x is "value2" 39indexObject.get('value') 40PASS event.target.result.x is "value" 41PASS event.target.result.y is "zzz" 42indexObject.getKey('does not exist') 43PASS event.target.errorCode is webkitIDBDatabaseException.NOT_FOUND_ERR 44event.preventDefault() 45indexObject.get('does not exist') 46PASS event.target.errorCode is webkitIDBDatabaseException.NOT_FOUND_ERR 47event.preventDefault() 48indexObject4.getKey('value2') 49PASS event.target.result is "key2" 50indexObject.openKeyCursor() 51PASS event.target.source is indexObject 52PASS event.target.result === null is false 53PASS event.target.result.key is "value" 54PASS event.target.result.primaryKey is "key" 55event.target.result.continue() 56PASS event.target.result === null is false 57PASS event.target.result.key is "value2" 58PASS event.target.result.primaryKey is "key2" 59event.target.result.continue() 60PASS event.target.result === null is true 61indexObject.openCursor() 62PASS event.target.source is indexObject 63PASS event.target.result === null is false 64PASS event.target.result.key is "value" 65PASS event.target.result.value.x is "value" 66PASS event.target.result.value.y is "zzz" 67event.target.result.continue() 68PASS event.target.result === null is false 69PASS event.target.result.key is "value2" 70PASS event.target.result.value.x is "value2" 71PASS event.target.result.value.y is "zzz2" 72event.target.result.continue() 73PASS event.target.result === null is true 74Passing an invalid key into indexObject.get(). 75PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17 76Passing an invalid key into indexObject.getKey(). 77PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17 78PASS successfullyParsed is true 79 80TEST COMPLETE 81 82