Upstream version 10.38.222.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / workers / storage / resources / interrupt-database.js
1 var counter = 0;
2 function runTransaction()
3 {
4     db.transaction(function(tx) {
5         tx.executeSql("INSERT INTO Test VALUES (1)");
6         tx.executeSql("DELETE FROM Test WHERE Foo = 1");
7         if (++counter == 100)
8             postMessage("terminate");
9     }, null, runTransaction);
10 }
11
12 var db = openDatabase("InterruptDatabaseTest", "1", "", 1);
13 db.transaction(function(tx) {
14     tx.executeSql("CREATE TABLE IF NOT EXISTS Test (Foo INT)");
15 }, function(error) {
16     postMessage("Error: " + error.message);
17 }, function() {
18     runTransaction();
19 });