summaryrefslogtreecommitdiffstats
path: root/WebCore/manual-tests/database-threading-stress-test-2.html
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:30:52 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:30:52 -0800
commit8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2 (patch)
tree11425ea0b299d6fb89c6d3618a22d97d5bf68d0f /WebCore/manual-tests/database-threading-stress-test-2.html
parent648161bb0edfc3d43db63caed5cc5213bc6cb78f (diff)
downloadexternal_webkit-8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2.zip
external_webkit-8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2.tar.gz
external_webkit-8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2.tar.bz2
auto import from //depot/cupcake/@135843
Diffstat (limited to 'WebCore/manual-tests/database-threading-stress-test-2.html')
-rw-r--r--WebCore/manual-tests/database-threading-stress-test-2.html51
1 files changed, 51 insertions, 0 deletions
diff --git a/WebCore/manual-tests/database-threading-stress-test-2.html b/WebCore/manual-tests/database-threading-stress-test-2.html
new file mode 100644
index 0000000..b99af3c
--- /dev/null
+++ b/WebCore/manual-tests/database-threading-stress-test-2.html
@@ -0,0 +1,51 @@
+<!doctype html>
+<html>
+<head>
+<script>
+var db;
+
+try {
+ if (window.openDatabase) {
+ db = openDatabase("StressTest2", "1.0", "Database stress test", 200000);
+ if (!db)
+ alert("Failed to open the database on disk. This is probably because the version was bad or there is not enough space left in this domain's quota");
+ } else
+ alert("Couldn't open the database. Please try with a WebKit nightly with this feature enabled");
+} catch(err) { }
+
+function loaded()
+{
+ db.transaction(function(tx) {
+ tx.executeSql("SELECT COUNT(*) FROM WebkitStickyNotes", [], function(result) {
+ loadNotes();
+ }, function(tx, error) {
+ tx.executeSql("CREATE TABLE WebKitStickyNotes (id REAL UNIQUE, note TEXT)", [], function(result) {
+ tx.executeSql("INSERT INTO WebKitStickyNotes (id, note) VALUES (?, ?)", [1, 'Text'], function(result) {
+ tx.executeSql("INSERT INTO WebKitStickyNotes (id, note) VALUES (?, ?)", [2, 'More Text'], function(result) {
+ loadNotes();
+ });
+ });
+ });
+ });
+ });
+}
+
+function loadNotes()
+{
+ db.transaction(function(tx) {
+ tx.executeSql("SELECT id, note FROM WebKitStickyNotes", [], function(tx, result) {
+ loadNotes();
+ }, function(tx, error) {
+ alert('Failed to retrieve notes from database - ' + error.message);
+ return;
+ });
+ });
+}
+
+addEventListener('load', loaded, false);
+</script>
+</head>
+<body>
+<p>This test needs to run without crashes and assertion failures for a while.<p>
+</body>
+</html>