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;
|
var that = this;
|
||||||
|
|
||||||
function cleanup(callback) {
|
function cleanup(callback) {
|
||||||
|
callback = callback || function(){};
|
||||||
|
|
||||||
if(!that.provider || _done) {
|
if(!that.provider || _done) {
|
||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
|
@ -27,7 +29,6 @@ function IndexedDBTestProvider(name) {
|
||||||
that.provider.db.close();
|
that.provider.db.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
callback = callback || function(){};
|
|
||||||
var request = indexedDB.deleteDatabase(name);
|
var request = indexedDB.deleteDatabase(name);
|
||||||
function finished() {
|
function finished() {
|
||||||
that.provider = null;
|
that.provider = null;
|
||||||
|
|
|
@ -4,6 +4,8 @@ function MemoryTestProvider(name) {
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
function cleanup(callback) {
|
function cleanup(callback) {
|
||||||
|
callback = callback || function(){};
|
||||||
|
|
||||||
that.provider = null;
|
that.provider = null;
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,12 @@ function WebSQLTestProvider(name) {
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
function cleanup(callback) {
|
function cleanup(callback) {
|
||||||
|
callback = callback || function(){};
|
||||||
|
|
||||||
if(!that.provider || _done) {
|
if(!that.provider || _done) {
|
||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Provider is there, but db was never touched
|
// Provider is there, but db was never touched
|
||||||
if(!that.provider.db) {
|
if(!that.provider.db) {
|
||||||
return callback();
|
return callback();
|
||||||
|
|
Loading…
Reference in New Issue