fune/browser/components/migration/tests/unit/test_MigrationUtils_timedRetry.js
Victor Porof 1f830c96da Bug 1561435 - Format browser/components/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D36042

--HG--
extra : source : d3afcafdce650a6f36cebbc126ee93b17f13cf52
2019-07-05 09:53:32 +02:00

27 lines
734 B
JavaScript

"use strict";
ChromeUtils.defineModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
let tmpFile = FileUtils.getDir("TmpD", [], true);
let dbConn;
add_task(async function setup() {
tmpFile.append("TestDB");
dbConn = await Sqlite.openConnection({ path: tmpFile.path });
registerCleanupFunction(() => {
dbConn.close();
OS.File.remove(tmpFile.path);
});
});
add_task(async function testgetRowsFromDBWithoutLocksRetries() {
let promise = MigrationUtils.getRowsFromDBWithoutLocks(
tmpFile.path,
"Temp DB",
"SELECT * FROM moz_temp_table"
);
await new Promise(resolve => do_timeout(50, resolve));
dbConn.execute("CREATE TABLE moz_temp_table (id INTEGER PRIMARY KEY)");
await promise;
});