summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/null-callbacks.html
blob: 4ca0e1c3ffbcd336610dfa37a58769f02c48696e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<html>
<head>
<script>
function finishTest()
{
    if (window.layoutTestController)
        layoutTestController.notifyDone();
}

function runTest()
{
    if (window.layoutTestController) {
        layoutTestController.clearAllDatabases();
        layoutTestController.dumpAsText();
        layoutTestController.waitUntilDone();
    }

    try {
        var db = openDatabase("NullCallbacks", "1.0", "Test for null callbacks.", 1);
        db.transaction(function(tx) {
            tx.executeSql("CREATE TABLE IF NOT EXISTS Test (Foo INT)", null);
            tx.executeSql("INSERT INTO Test VALUES (?)", [1], null, null);
            tx.executeSql("INSERT INTO Test VALUES (?)", [2], null);
            tx.executeSql("INSERT INTO Test VALUES (3)", null, null, null);
            tx.executeSql("INSERT INTO Test VALUES (?)", [4], null,
                function(tx, error) {});
        }, null, null);

        db.transaction(function(tx) {
            tx.executeSql("INSERT INTO Test VALUES (?)", [5]);
        }, null, function() { finishTest(); });
    } catch(err) {
        document.getElementById("console").innerHTML = "FAIL";
        finishTest();
    }
}

</script>
</head>

<body onload="runTest()">
This test checks that 'null' can be used wherever we expect an optional callback.
<pre id="console">PASS</pre>
</body>

</html>