diff options
Diffstat (limited to 'tests/auto/declarative/sql/data/1-creation.js')
-rw-r--r-- | tests/auto/declarative/sql/data/1-creation.js | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/tests/auto/declarative/sql/data/1-creation.js b/tests/auto/declarative/sql/data/1-creation.js index 95fa99e..aab9b5d 100644 --- a/tests/auto/declarative/sql/data/1-creation.js +++ b/tests/auto/declarative/sql/data/1-creation.js @@ -1,20 +1,15 @@ -var db = openDatabase("QmlTestDB", "", "Test database from Qt autotests", 1000000); -var r="transaction_not_finished"; +function test() { + var db = openDatabaseSync("QmlTestDB", "", "Test database from Qt autotests", 1000000); + var r="transaction_not_finished"; -// Asynchronous in WebKit, so must wait before calling test() -db.transaction( - function(tx) { - tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)', [], - function(tx, rs) { }, function(tx, error) { r="CREATE FAILED: "+error.message }); - tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ], - function(tx, rs) { }, function(tx, error) { r="INSERT FAILED: "+error.message }); - }, - function(tx, error) { r="TRANSACTION FAILED: "+error.message }, - function(tx, result) { if (r=="transaction_not_finished") r="passed" } -); + // Asynchronous in WebKit, so must wait before calling test() + db.transaction( + function(tx) { + tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)'); + tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]); + r = "passed"; + } + ); - -function test() -{ return r; } |