зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1140389 - Fix test_SQLiteStore.js and test_ReadingList.js failures on Windows due to NS_ERROR_FILE_IS_LOCKED. r=Unfocused
This commit is contained in:
Родитель
5915828861
Коммит
304f2462ea
|
@ -126,11 +126,16 @@ this.SQLiteStore.prototype = {
|
|||
/**
|
||||
* Call this when you're done with the store. Don't use it afterward.
|
||||
*/
|
||||
destroy: Task.async(function* () {
|
||||
let conn = yield this._connectionPromise;
|
||||
yield conn.close();
|
||||
this._connectionPromise = Promise.reject("Store destroyed");
|
||||
}),
|
||||
destroy() {
|
||||
if (!this._destroyPromise) {
|
||||
this._destroyPromise = Task.spawn(function* () {
|
||||
let conn = yield this._connectionPromise;
|
||||
yield conn.close();
|
||||
this._connectionPromise = Promise.reject("Store destroyed");
|
||||
}.bind(this));
|
||||
}
|
||||
return this._destroyPromise;
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates the database connection if it hasn't been created already.
|
||||
|
|
|
@ -21,7 +21,9 @@ add_task(function* prepare() {
|
|||
gList = ReadingList;
|
||||
Assert.ok(gList);
|
||||
gDBFile.append(gList._store.pathRelativeToProfileDir);
|
||||
do_register_cleanup(() => {
|
||||
do_register_cleanup(function* () {
|
||||
// Wait for the list's store to close its connection to the database.
|
||||
yield gList.destroy();
|
||||
if (gDBFile.exists()) {
|
||||
gDBFile.remove(true);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,11 @@ add_task(function* prepare() {
|
|||
}
|
||||
}
|
||||
removeDB();
|
||||
do_register_cleanup(removeDB);
|
||||
do_register_cleanup(function* () {
|
||||
// Wait for the store to close its connection to the database.
|
||||
yield gStore.destroy();
|
||||
removeDB();
|
||||
});
|
||||
|
||||
gStore = new SQLiteStore(dbFile.path);
|
||||
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
head = head.js
|
||||
firefox-appdir = browser
|
||||
|
||||
;[test_ReadingList.js]
|
||||
[test_ReadingList.js]
|
||||
[test_scheduler.js]
|
||||
;[test_SQLiteStore.js]
|
||||
[test_SQLiteStore.js]
|
||||
|
|
Загрузка…
Ссылка в новой задаче