summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/multiple-transactions.js
blob: 85cdabcdbdd64c3b4a1dd63f3531586962cad619 (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
var complete = 0;

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

function runTest()
{
    var db = openDatabaseWithSuffix("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();
    });
}