michael@0: /** michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: michael@0: var testGenerator = testSteps(); michael@0: michael@0: function testSteps() michael@0: { michael@0: const name = this.window ? window.location.pathname : "Splendid Test"; michael@0: const objectStoreName = "Objects"; michael@0: michael@0: let request = indexedDB.open(name, 1); michael@0: request.onerror = errorHandler; michael@0: request.onupgradeneeded = grabEventAndContinueHandler; michael@0: request.onsuccess = grabEventAndContinueHandler; michael@0: let event = yield undefined; michael@0: michael@0: let db = event.target.result; michael@0: is(db.objectStoreNames.length, 0, "Bad objectStores list"); michael@0: michael@0: let objectStore = db.createObjectStore(objectStoreName, michael@0: { keyPath: "foo" }); michael@0: michael@0: is(db.objectStoreNames.length, 1, "Bad objectStores list"); michael@0: is(db.objectStoreNames.item(0), objectStoreName, "Bad name"); michael@0: michael@0: yield undefined; michael@0: michael@0: objectStore = db.transaction(objectStoreName).objectStore(objectStoreName); michael@0: michael@0: is(objectStore.name, objectStoreName, "Bad name"); michael@0: is(objectStore.keyPath, "foo", "Bad keyPath"); michael@0: if(objectStore.indexNames.length, 0, "Bad indexNames"); michael@0: michael@0: finishTest(); michael@0: yield undefined; michael@0: } michael@0: