summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/multiple-transactions.html
blob: 56656ca55571cdd706763d061073f948deaa4570 (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
47
48
49
50
51
52
53
<html>
<head>
<script>

function log(message)
{
    document.body.innerHTML += message + "<br>";
}

var complete = 0;

function checkCompletion()
{
    if (++complete == 2 && window.layoutTestController)
        layoutTestController.notifyDone();
}

function runTest()
{
    if (window.layoutTestController) {
        layoutTestController.dumpAsText();
        layoutTestController.waitUntilDone();
    }
    
    var db = openDatabase("MultipleTransactionsTest", "1.0", "Test to make sure multiple transactions can be queued at once for an HTML5 database", 32768);

    db.transaction(function(tx) {
        log("Transaction 1 Started");
    }, function(err) {
        log("Transaction 1 Errored - " + err);
        checkCompletion();
    }, function() {
        log("Transaction 1 Succeeded");
        checkCompletion();
    });

    db.transaction(function(tx) {
        log("Transaction 2 Started");
    }, function(err) {
        log("Transaction 2 Errored - " + err);
        checkCompletion();
    }, function() {
        log("Transaction 2 Succeeded");
        checkCompletion();
    });
}

</script>
<head>
<body onload="runTest();">
This is a test to see if the database API allows multiple transactions to be queued on the same database at once:<br>
</body>
</html>