summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/database-lock-after-reload.html
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-04-27 16:31:00 +0100
committerSteve Block <steveblock@google.com>2010-05-11 14:42:12 +0100
commitdcc8cf2e65d1aa555cce12431a16547e66b469ee (patch)
tree92a8d65cd5383bca9749f5327fb5e440563926e6 /LayoutTests/storage/database-lock-after-reload.html
parentccac38a6b48843126402088a309597e682f40fe6 (diff)
downloadexternal_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.zip
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.gz
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.bz2
Merge webkit.org at r58033 : Initial merge by git
Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
Diffstat (limited to 'LayoutTests/storage/database-lock-after-reload.html')
-rw-r--r--LayoutTests/storage/database-lock-after-reload.html34
1 files changed, 16 insertions, 18 deletions
diff --git a/LayoutTests/storage/database-lock-after-reload.html b/LayoutTests/storage/database-lock-after-reload.html
index 8bdaddc..5b5989f 100644
--- a/LayoutTests/storage/database-lock-after-reload.html
+++ b/LayoutTests/storage/database-lock-after-reload.html
@@ -1,8 +1,6 @@
<html>
<head>
<script>
-var database;
-
function log(message)
{
document.getElementById("console").innerHTML += message + "<br>";
@@ -15,7 +13,7 @@ function finishTest()
layoutTestController.notifyDone();
}
-function errorFunction(tx, error)
+function errorFunction(error)
{
log("Test failed - " + error.message);
finishTest();
@@ -23,16 +21,16 @@ function errorFunction(tx, error)
function addData(db)
{
- db.transaction(function(tx) {
+ db.transaction(function(tx) {
log("Inserting some data");
- // Insert a large amount of data that will take a little while to run. Schedule a timout to run that will load a new page
- // whilst the transaction is still in progress, interrupting the transaction. This should not leave the database locked and on
- // the next page we should be able to insert some more data.
- tx.executeSql("INSERT INTO DataTest (testData) VALUES (ZEROBLOB(524200))", [], function(tx, result) { }, errorFunction);
- location.href = "./resources/database-lock-after-reload-2.html";
- }, errorFunction, function() {
- finishTest();
- });
+ // Load a new page while the transaction is still in progress, interrupting the transaction.
+ // This should not leave the database locked and on the next page we should be able to insert
+ // some more data.
+ tx.executeSql("INSERT INTO DataTest (testData) VALUES (ZEROBLOB(524200))", [],
+ function(tx, result) { location.href = "./resources/database-lock-after-reload-2.html"; },
+ function(tx, error) { errorFunction(error); });
+ tx.executeSql("INSERT INTO DataTest (testData) VALUES (ZEROBLOB(524200))");
+ }, errorFunction, function() { finishTest(); });
}
function runTest()
@@ -42,20 +40,20 @@ function runTest()
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
-
+
+ var database;
try {
database = openDatabase("DatabaseLockTest", "1.0", "Test for database locking", 5242880);
} catch (e) {
log("Error - could not open database");
finishTest();
}
-
+
database.transaction(function(tx) {
log("Adding a table");
- tx.executeSql("CREATE TABLE DataTest (testData)", [], function(tx, result) { }, errorFunction);
- }, errorFunction, function() {
- addData(database);
- });
+ tx.executeSql("CREATE TABLE DataTest (testData)", [], function(tx, result) { },
+ function(tx, error) { errorFunction(error); });
+ }, errorFunction, function() { addData(database); });
}
</script>