Ensure test providers deal with missing callback early
This commit is contained in:
parent
b1cf2d7dfb
commit
4cdcca1a8d
|
@ -17,6 +17,8 @@ function IndexedDBTestProvider(name) {
|
|||
var that = this;
|
||||
|
||||
function cleanup(callback) {
|
||||
callback = callback || function(){};
|
||||
|
||||
if(!that.provider || _done) {
|
||||
return callback();
|
||||
}
|
||||
|
@ -27,7 +29,6 @@ function IndexedDBTestProvider(name) {
|
|||
that.provider.db.close();
|
||||
}
|
||||
|
||||
callback = callback || function(){};
|
||||
var request = indexedDB.deleteDatabase(name);
|
||||
function finished() {
|
||||
that.provider = null;
|
||||
|
|
|
@ -4,6 +4,8 @@ function MemoryTestProvider(name) {
|
|||
var that = this;
|
||||
|
||||
function cleanup(callback) {
|
||||
callback = callback || function(){};
|
||||
|
||||
that.provider = null;
|
||||
callback();
|
||||
}
|
||||
|
|
|
@ -12,9 +12,12 @@ function WebSQLTestProvider(name) {
|
|||
var that = this;
|
||||
|
||||
function cleanup(callback) {
|
||||
callback = callback || function(){};
|
||||
|
||||
if(!that.provider || _done) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
// Provider is there, but db was never touched
|
||||
if(!that.provider.db) {
|
||||
return callback();
|
||||
|
|
Loading…
Reference in New Issue