Passing 1/4 failing tests now
This commit is contained in:
parent
58392efd10
commit
c92d3a6c5f
|
@ -55,7 +55,7 @@ define(function(require) {
|
||||||
callback(error);
|
callback(error);
|
||||||
}
|
}
|
||||||
this.getTransaction(function(transaction) {
|
this.getTransaction(function(transaction) {
|
||||||
transaction.executeSql("INSERT OR REPLACE INTO " + FILE_STORE_NAME + " (id, data)",
|
transaction.executeSql("INSERT OR REPLACE INTO " + FILE_STORE_NAME + " (id, data) VALUES (?, ?)",
|
||||||
[key, value], onSuccess, onError);
|
[key, value], onSuccess, onError);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,20 +2,18 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
|
|
||||||
var WEBSQL_NAME = "websql-test-db";
|
var WEBSQL_NAME = "websql-test-db";
|
||||||
|
|
||||||
function wipeDB() {
|
function wipeDB(provider) {
|
||||||
var provider = new IDBFS.FileSystem.providers.WebSQL(WEBSQL_NAME);
|
var context = provider.getReadWriteContext();
|
||||||
provider.open(function(err, firstAccess) {
|
context.clear(function(err) {
|
||||||
if(err) {
|
console.error("Problem clearing WebSQL db: " + err);
|
||||||
console.error("Problem clearing WebSQL db: " + err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var context = provider.getReadWriteContext();
|
|
||||||
context.clear(function(err) {
|
|
||||||
console.error("Problem clearing WebSQL db: " + err);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!IDBFS.FileSystem.providers.WebSQL.isSupported()) {
|
||||||
|
console.log("Skipping IDBFS.FileSystem.providers.WebSQL tests, since WebSQL isn't supported.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
describe("IDBFS.FileSystem.providers.WebSQL", function() {
|
describe("IDBFS.FileSystem.providers.WebSQL", function() {
|
||||||
it("is supported -- if it isn't, none of these tests can run.", function() {
|
it("is supported -- if it isn't, none of these tests can run.", function() {
|
||||||
expect(IDBFS.FileSystem.providers.WebSQL.isSupported()).toEqual(true);
|
expect(IDBFS.FileSystem.providers.WebSQL.isSupported()).toEqual(true);
|
||||||
|
@ -29,19 +27,15 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("open an WebSQL provider", function() {
|
describe("open an WebSQL provider", function() {
|
||||||
beforeEach(function() {
|
|
||||||
wipeDB();
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
wipeDB();
|
wipeDB(this.provider);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should open a new WebSQL database", function() {
|
it("should open a new WebSQL database", function() {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result;
|
var _error, _result;
|
||||||
|
|
||||||
var provider = new IDBFS.FileSystem.providers.WebSQL(WEBSQL_NAME);
|
var provider = this.provider = this.provider = new IDBFS.FileSystem.providers.WebSQL(WEBSQL_NAME);
|
||||||
provider.open(function(err, firstAccess) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
_result = firstAccess;
|
_result = firstAccess;
|
||||||
|
@ -60,19 +54,15 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Read/Write operations on an WebSQL provider", function() {
|
describe("Read/Write operations on an WebSQL provider", function() {
|
||||||
beforeEach(function() {
|
|
||||||
wipeDB();
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
wipeDB();
|
wipeDB(this.provider);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should allow put() and get()", function() {
|
it("should allow put() and get()", function() {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result;
|
var _error, _result;
|
||||||
|
|
||||||
var provider = new IDBFS.FileSystem.providers.WebSQL(WEBSQL_NAME);
|
var provider = this.provider = new IDBFS.FileSystem.providers.WebSQL(WEBSQL_NAME);
|
||||||
provider.open(function(err, firstAccess) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
|
|
||||||
|
@ -102,7 +92,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result;
|
var _error, _result;
|
||||||
|
|
||||||
var provider = new IDBFS.FileSystem.providers.WebSQL(WEBSQL_NAME);
|
var provider = this.provider = new IDBFS.FileSystem.providers.WebSQL(WEBSQL_NAME);
|
||||||
provider.open(function(err, firstAccess) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
|
|
||||||
|
@ -135,7 +125,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result1, _result2;
|
var _error, _result1, _result2;
|
||||||
|
|
||||||
var provider = new IDBFS.FileSystem.providers.WebSQL(WEBSQL_NAME);
|
var provider = this.provider = new IDBFS.FileSystem.providers.WebSQL(WEBSQL_NAME);
|
||||||
provider.open(function(err, firstAccess) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
|
|
||||||
|
@ -179,7 +169,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result;
|
var _error, _result;
|
||||||
|
|
||||||
var provider = new IDBFS.FileSystem.providers.WebSQL(WEBSQL_NAME);
|
var provider = this.provider = new IDBFS.FileSystem.providers.WebSQL(WEBSQL_NAME);
|
||||||
provider.open(function(err, firstAccess) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue