summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/sql/data/test1.js
blob: 2ae99888f1acf3ab85efb1e288501b6f511bc313 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var db;
db = openDatabase("QmlTestDB", "", "Test database from Qt autotests", 1000000);
var r="testerror";

// 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" });


function test()
{
    return r;
}