2 * Any copyright is dedicated to the Public Domain.
3 * http://creativecommons.org/publicdomain/zero/1.0/
6 /* exported testGenerator */
7 var testGenerator = testSteps();
9 function* testSteps() {
10 const Bob = { ss: "237-23-7732", name: "Bob" };
12 let request = indexedDB.open(
13 this.window ? window.location.pathname : "Splendid Test",
16 request.onerror = errorHandler;
17 request.onupgradeneeded = grabEventAndContinueHandler;
18 let event = yield undefined;
20 let db = event.target.result;
21 event.target.onsuccess = continueToNextStep;
23 let objectStore = db.createObjectStore("foo", { keyPath: "ss" });
24 objectStore.createIndex("name", "name", { unique: true });
29 .transaction("foo", "readwrite")
32 .openCursor().onsuccess = function(event) {
33 event.target.transaction.oncomplete = continueToNextStep;
34 let cursor = event.target.result;
36 let objectStore = event.target.transaction.objectStore("foo");
37 objectStore.delete(Bob.ss).onsuccess = function(event) {
45 objectStore = null; // Bug 943409 workaround.