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: var request = indexedDB.open(name, 1); michael@0: request.onerror = errorHandler; michael@0: request.onupgradeneeded = grabEventAndContinueHandler; michael@0: var event = yield undefined; michael@0: michael@0: is(event.target.source, null, "correct event.target.source"); michael@0: michael@0: var db = event.target.result; michael@0: var objectStore = db.createObjectStore(objectStoreName, michael@0: { autoIncrement: true }); michael@0: request = objectStore.add({}); michael@0: request.onerror = errorHandler; michael@0: request.onsuccess = grabEventAndContinueHandler; michael@0: event = yield undefined; michael@0: michael@0: ok(event.target.source === objectStore, "correct event.source"); michael@0: michael@0: finishTest(); michael@0: yield undefined; michael@0: }