diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-09-24 04:57:22 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-09-24 04:57:22 (GMT) |
commit | 74a66e291be2f216f88491e518add9ef72a730f2 (patch) | |
tree | 24674175d1e3e24f7fe3b5cec226a73c24bab2ad /tests/auto/declarative/sql | |
parent | 04ec3b71ff6327a17da2c5044a4086e9eddca5cd (diff) | |
download | Qt-74a66e291be2f216f88491e518add9ef72a730f2.zip Qt-74a66e291be2f216f88491e518add9ef72a730f2.tar.gz Qt-74a66e291be2f216f88491e518add9ef72a730f2.tar.bz2 |
Tidy JS
Diffstat (limited to 'tests/auto/declarative/sql')
-rw-r--r-- | tests/auto/declarative/sql/data/test1.js | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/auto/declarative/sql/data/test1.js b/tests/auto/declarative/sql/data/test1.js index ea3b7b0..95fa99e 100644 --- a/tests/auto/declarative/sql/data/test1.js +++ b/tests/auto/declarative/sql/data/test1.js @@ -1,14 +1,17 @@ var db = openDatabase("QmlTestDB", "", "Test database from Qt autotests", 1000000); -var r="testerror"; +var r="transaction_not_finished"; // Asynchronous in WebKit, so must wait before calling test() -db.transaction(function(tx) { - r = "passed"; - tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)', [], - function(tx, rs) { }, function(tx, error) { r="FAILED: "+error.message }); - tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ], - function(tx, rs) { }, function(tx, error) { r="FAILED: "+error.message }); -}, function(tx, error) { r="TXFAILED: "+error.message }, function(tx, result) { if (r=="testerror") r="passed" }); +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" } +); function test() |