for (let i = 0; i < transactionCount; i++) { const readonly = i % 2 == 0; const mode = readonly ? "readonly" : "readwrite";
let transaction = db.transaction(objStoreName, mode);
if (i == transactionCount - 1) { // Last one, finish the test.
transaction.oncomplete = grabEventAndContinueHandler;
} elseif (i == abortedTransactionIndex - 1) {
transaction.oncomplete = function () {
ok( true, "Completed transaction " +
++completedTransactionCount + " (We may hang after this!)"
);
};
} elseif (i == abortedTransactionIndex) { // Special transaction that we abort outside the normal event flow.
transaction.onerror = function (event) {
ok( true, "Aborted transaction " +
++completedTransactionCount + " (We didn't hang!)"
);
is(
event.target.error.name, "AbortError", "AbortError set as the error on the request"
);
is(
event.target.transaction.error, null, "No error set on the transaction"
);
ok(!caughtError, "Haven't seen the error event yet");
caughtError = true;
event.preventDefault();
}; // This has to happen after the we return to the event loop but before the // transaction starts running.
executeSoon(function () {
transaction.abort();
});
} else {
transaction.oncomplete = function () {
ok(true, "Completed transaction " + ++completedTransactionCount);
};
}
if (readonly) {
transaction.objectStore(objStoreName).get(0);
} else { try {
transaction.objectStore(objStoreName).add({});
} catch (e) {}
}
}
ok(true, "Created all transactions");
event = yield undefined;
ok(true, "Completed transaction " + ++completedTransactionCount);
ok(caughtError, "Caught the error event when we aborted the transaction");
finishTest();
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.22 Sekunden
(vorverarbeitet am 2026-08-25)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.