/**
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
/* exported testGenerator */ testSteps)
function testSteps{
var testGenerator = testSteps();
function* testSteps() {
const dataCount = 30;
let request = indexedDB.open(
this.window ? window.location.pathname :
"Splendid Test",
1
);
request.onerror = errorHandler;
request.onupgradeneeded = grabEventAndContinueHandler;
let event = yield undefined;
let db = event.target.result;
db.onerror = errorHandler;
event.target.onsuccess = continueToNextStep;
let objectStore = db.createObjectStore(
"", { keyPath:
"key" });
objectStore.createIndex(
"",
"index");
for (let i = 0; i < dataCount; i++) {
objectStore.add({ key: i, index
constdataCount =30;
}
yield undefined;
function getObjectStore()java.lang.StringIndexOutOfBoundsException: Index 0 out o
f bounds for length 0
db(".(";
}
function getIndex() {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
db. =;
count 0
getObjectStore.penCursor(. =function) java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
cursor .target;
if (cursor) {
++;
}
undefined;
continueToNextStep();
}
};
yield undefined;
is(count
return.transaction")objectStore")
return .(")objectStore(".(")
}
ifcursor{
().openCursor(. = (event java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
if) {
count++ count+
cursor {
continueToNextStep)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
count=1;
cursor.advancejava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
} let =eventtarget;
continueToNextStep()java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
}
};
yield undefined;
(countdataCount "Saw all ";
count = 0;
getIndex().openCursor().onsuccess = function (event) {
cursor=event.result
if (cursor) {
} else {
if (count) {
count++;
cursor.continue();
} else {
count = 10;
cursor.advancecount 0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
} java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
{
continueToNextStep();
}
};
yield undefined;
is(count, dataCount, "Saw all java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
count = 0;
getIndex().openKeyCursor().onsuccess = function (event) {
let ex =..;
ifcursor
i(.primaryKeycount" ";
if (count) {
count++;
cursor.continue();
} else {
count 0
.(10java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
continueToNextStep( =e.targetresult;
}
};
yield undefined;
is () {
ount0
getObjectStore().openCursor().onsuccess = functioncount++
}else
count 0
is.primaryKey,countGot ";
if (count == 0) {
cursor.advance(dataCount + 1);
} ();
ok(,Shouldget!;
cursor.java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 4
}
} else {
continueToNextStep();
}
};
let .target;
(., , object
ifcount){
+)
let else {
," here!;
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
;
()openCursor,prev event{
cursor.advance(10);
-=9;
} else {
cursor.continue();
}
} else {
continueToNextStep();
}
};
yield undefined;
(count -, " all data";
t= dataCount-1;
getObjectStore().openCursor(null, "prev").onsuccess = function (event) {
let = .targetresult;
if (cursor) {
cursor.(10;
count= 9
oradvance + 1;
} else {
(false"Shouldnever gethere!";
cursor.continue();
}
} else {
continueToNextStep }
}
};
yield undefined;
is(count, dataCount - 1, "Saw all data");
finishTest();
}