diff -r 93b982ccede2 -r 5daf16870df6 tests/auto/declarative/qdeclarativesqldatabase/data/readonly.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/auto/declarative/qdeclarativesqldatabase/data/readonly.js Thu Jul 22 16:41:55 2010 +0100 @@ -0,0 +1,24 @@ +function test() { + var r="transaction_not_finished"; + var db = openDatabaseSync("QmlTestDB-readonly", "1.0", "Test database from Qt autotests", 1000000); + + 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"; + } + ); + + db.readTransaction( + function(tx) { + var rs = tx.executeSql('SELECT * FROM Greeting'); + if (rs.rows.item(0).salutation == 'hello') + r = "passed"; + else + r = "FAILED"; + } + ); + + return r; +}