1
0
Fork 0
firefox/browser/components/migration/tests/unit/test_MigrationUtils_timedRetry.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

29 lines
761 B
JavaScript

"use strict";
let tmpFile = FileUtils.getDir("TmpD", []);
let dbConn;
add_task(async function setup() {
tmpFile.append("TestDB");
dbConn = await Sqlite.openConnection({ path: tmpFile.path });
registerCleanupFunction(async () => {
await dbConn.close();
await IOUtils.remove(tmpFile.path);
});
});
add_task(async function testgetRowsFromDBWithoutLocksRetries() {
let deferred = Promise.withResolvers();
let promise = MigrationUtils.getRowsFromDBWithoutLocks(
tmpFile.path,
"Temp DB",
"SELECT * FROM moz_temp_table",
deferred.promise
);
await new Promise(resolve => do_timeout(50, resolve));
dbConn
.execute("CREATE TABLE moz_temp_table (id INTEGER PRIMARY KEY)")
.then(deferred.resolve);
await promise;
});