diff options
Diffstat (limited to 'browser/components/migration/tests/unit/test_MigrationUtils_timedRetry.js')
-rw-r--r-- | browser/components/migration/tests/unit/test_MigrationUtils_timedRetry.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/browser/components/migration/tests/unit/test_MigrationUtils_timedRetry.js b/browser/components/migration/tests/unit/test_MigrationUtils_timedRetry.js new file mode 100644 index 0000000000..546b7bae88 --- /dev/null +++ b/browser/components/migration/tests/unit/test_MigrationUtils_timedRetry.js @@ -0,0 +1,25 @@ +"use strict"; + +let tmpFile = FileUtils.getDir("TmpD", [], true); +let dbConn; + +add_task(async function setup() { + tmpFile.append("TestDB"); + dbConn = await Sqlite.openConnection({ path: tmpFile.path }); + + registerCleanupFunction(async () => { + await dbConn.close(); + IOUtils.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; +}); |