1var complete = 0;
2
3function checkCompletion()
4{
5    if (++complete == 2 && window.layoutTestController)
6        layoutTestController.notifyDone();
7}
8
9function runTest()
10{
11    var db = openDatabaseWithSuffix("MultipleTransactionsTest", "1.0", "Test to make sure multiple transactions can be queued at once for an HTML5 database", 32768);
12
13    db.transaction(function(tx) {
14        log("Transaction 1 Started");
15    }, function(err) {
16        log("Transaction 1 Errored - " + err);
17        checkCompletion();
18    }, function() {
19        log("Transaction 1 Succeeded");
20        checkCompletion();
21    });
22
23    db.transaction(function(tx) {
24        log("Transaction 2 Started");
25    }, function(err) {
26        log("Transaction 2 Errored - " + err);
27        checkCompletion();
28    }, function() {
29        log("Transaction 2 Succeeded");
30        checkCompletion();
31    });
32}
33