diff options
Diffstat (limited to 'LayoutTests/storage/resources/database-lock-after-reload-2.html')
-rw-r--r-- | LayoutTests/storage/resources/database-lock-after-reload-2.html | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/LayoutTests/storage/resources/database-lock-after-reload-2.html b/LayoutTests/storage/resources/database-lock-after-reload-2.html new file mode 100644 index 0000000..d73a0df --- /dev/null +++ b/LayoutTests/storage/resources/database-lock-after-reload-2.html @@ -0,0 +1,59 @@ +<html> +<head> +<script> +var database; + +function log(message) +{ + document.getElementById("console").innerHTML += message + "<br>"; +} + +function finishTest() +{ + log("Test part 2 Complete"); + if (window.layoutTestController) + layoutTestController.notifyDone(); +} + +function errorFunction(tx, error) +{ + log("Test failed - " + error.message); + finishTest(); +} + +function addData(db) +{ + db.transaction(function(tx) { + log("Inserting some data"); + + tx.executeSql("INSERT INTO DataTest (testData) VALUES (?)", ["A"], function(tx, result) { }, errorFunction); + }, function(){}, function() { + finishTest(); + }); +} + +function runTest() +{ + if (window.layoutTestController) { + layoutTestController.dumpAsText(); + layoutTestController.waitUntilDone(); + } + + try { + database = openDatabase("DatabaseLockTest", "1.0", "Test for database locking", 5242880); + addData(database); + } catch(e) { + log("Error - could not open database"); + finishTest(); + } +} + +</script> +</head> + +<body onload="runTest()"> +<pre id="console"> +</pre> +</body> + +</html> |