diff options
author | Steve Block <steveblock@google.com> | 2010-02-25 10:58:37 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-02-25 11:17:52 +0000 |
commit | cfb0617749a64f2e177386b030d46007b8c4b179 (patch) | |
tree | 033b0b4e1b1eaa96831b52fc1ec6675132f33035 /LayoutTests/storage/database-lock-after-reload.html | |
parent | 4175d59b46f96005f0c64978b1a94e3fe60f1e8e (diff) | |
download | external_webkit-cfb0617749a64f2e177386b030d46007b8c4b179.zip external_webkit-cfb0617749a64f2e177386b030d46007b8c4b179.tar.gz external_webkit-cfb0617749a64f2e177386b030d46007b8c4b179.tar.bz2 |
Adds layout tests for HTML5 features
The following layout tests should all pass on Android, as they are for recently
implemented HTML5 features ...
- fast/dom/Geolocation
- storage
- http/tests/appcache
This change adds these tests to the Android tree, at the current WebKit revision
r54731. This is so that we can easily keep track of which tests should always be
green, and so that we can add Android-specific test results.
We also add the following paths ...
- fast/js/resources - used by the Geolocation tests
- http/conf - used by the Appcache tests
Tests that are currently failing are added to the DumpRenderTree skipped list
temporarily, to keep all tests green.
Change-Id: Id96c05e3746ed64e4e4c40c99567b8def688f90a
Diffstat (limited to 'LayoutTests/storage/database-lock-after-reload.html')
-rw-r--r-- | LayoutTests/storage/database-lock-after-reload.html | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/LayoutTests/storage/database-lock-after-reload.html b/LayoutTests/storage/database-lock-after-reload.html new file mode 100644 index 0000000..ad34d5b --- /dev/null +++ b/LayoutTests/storage/database-lock-after-reload.html @@ -0,0 +1,69 @@ +<html> +<head> +<script> +var database; + +function log(message) +{ + document.getElementById("console").innerHTML += message + "<br>"; +} + +function finishTest() +{ + log("Test part 1 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"); + // 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 (randomBlob(524200 ))", [], function(tx, result) { }, errorFunction); + location.href = "./resources/database-lock-after-reload-2.html"; + }, errorFunction, function() { + finishTest(); + }); +} + +function runTest() +{ + if (window.layoutTestController) { + layoutTestController.clearAllDatabases(); + layoutTestController.dumpAsText(); + layoutTestController.waitUntilDone(); + } + + 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); + }); +} + +</script> +</head> + +<body onload="runTest()"> +<pre id="console"> +</pre> +</body> + +</html> |