mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
Tests: Delete the database when indexeddb-commit-error-event-order ends
This commit is contained in:
committed by
Alexander Kalenik
parent
55262fb6a3
commit
48c3dda3fe
Notes:
github-actions[bot]
2026-04-08 01:04:37 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/48c3dda3fe4 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8766 Reviewed-by: https://github.com/shannonbooth ✅
@@ -5,7 +5,10 @@ asyncTest(done => {
|
||||
setTimeout(() => {
|
||||
spoofCurrentURL("https://example.com/");
|
||||
|
||||
const openReq = indexedDB.open("commit-error-event-order", 1);
|
||||
const DB_NAME = "commit-error-event-order";
|
||||
|
||||
indexedDB.deleteDatabase(DB_NAME);
|
||||
const openReq = indexedDB.open(DB_NAME, 1);
|
||||
openReq.onupgradeneeded = (e) => {
|
||||
const db = e.target.result;
|
||||
db.createObjectStore("store", { keyPath: "key" });
|
||||
@@ -32,16 +35,20 @@ asyncTest(done => {
|
||||
ev.preventDefault();
|
||||
};
|
||||
|
||||
function theEnd() {
|
||||
db.close();
|
||||
indexedDB.deleteDatabase(DB_NAME);
|
||||
done();
|
||||
}
|
||||
|
||||
txn2.addEventListener("error", () => println("tx:error"));
|
||||
txn2.addEventListener("abort", () => {
|
||||
println("tx:abort");
|
||||
db.close();
|
||||
done();
|
||||
theEnd();
|
||||
});
|
||||
txn2.addEventListener("complete", () => {
|
||||
println("tx:complete");
|
||||
db.close();
|
||||
done();
|
||||
theEnd();
|
||||
});
|
||||
|
||||
txn2.commit();
|
||||
|
||||
Reference in New Issue
Block a user