From 74a66e291be2f216f88491e518add9ef72a730f2 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Thu, 24 Sep 2009 14:57:22 +1000 Subject: Tidy JS --- tests/auto/declarative/sql/data/test1.js | 19 +++++++++++-------- 1 file 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() -- cgit v0.12