[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

dumi at chromium.org dumi at chromium.org
Wed Dec 22 14:33:10 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 1972b24219448ca40366350aad469bbe1b79dcc8
Author: dumi at chromium.org <dumi at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 13 01:47:55 2010 +0000

    Test that workers can be successfully interrupted in the middle of DB operations.
    
    Reviewed by David Levin.
    
    * fast/workers/storage/interrupt-database-expected.txt: Added.
    * fast/workers/storage/interrupt-database-sync-expected.txt: Added.
    * fast/workers/storage/interrupt-database-sync.html: Added.
    * fast/workers/storage/interrupt-database.html: Added.
    * fast/workers/storage/resources/interrupt-database-sync.js: Added.
    * fast/workers/storage/resources/interrupt-database.js: Added.
    (runTransaction):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69631 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index c897b48..dfc6101 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-30  Dumitru Daniliuc  <dumi at chromium.org>
+
+        Reviewed by David Levin.
+
+        Test that workers can be successfully interrupted in the middle of DB operations.
+
+        * fast/workers/storage/interrupt-database-expected.txt: Added.
+        * fast/workers/storage/interrupt-database-sync-expected.txt: Added.
+        * fast/workers/storage/interrupt-database-sync.html: Added.
+        * fast/workers/storage/interrupt-database.html: Added.
+        * fast/workers/storage/resources/interrupt-database-sync.js: Added.
+        * fast/workers/storage/resources/interrupt-database.js: Added.
+        (runTransaction):
+
 2010-10-12  David Hyatt  <hyatt at apple.com>
 
         Reviewed by Dan Bernstein
diff --git a/LayoutTests/fast/workers/storage/interrupt-database-expected.txt b/LayoutTests/fast/workers/storage/interrupt-database-expected.txt
new file mode 100644
index 0000000..460a756
--- /dev/null
+++ b/LayoutTests/fast/workers/storage/interrupt-database-expected.txt
@@ -0,0 +1,3 @@
+This test makes sure that all async database operations are immediately interrupted when the worker needs to terminate.
+PASS: database operations interrupted.
+
diff --git a/LayoutTests/fast/workers/storage/interrupt-database-sync-expected.txt b/LayoutTests/fast/workers/storage/interrupt-database-sync-expected.txt
new file mode 100644
index 0000000..3139ddc
--- /dev/null
+++ b/LayoutTests/fast/workers/storage/interrupt-database-sync-expected.txt
@@ -0,0 +1,5 @@
+CONSOLE MESSAGE: line 7: DATABASE_ERR: DOM SQL Exception 1: The operation failed for some reason related to the database.
+CONSOLE MESSAGE: line 11: UNKNOWN_ERR: DOM SQL Exception 0: The operation failed for reasons unrelated to the database.
+This test makes sure that all sync database operations are immediately interrupted when the worker needs to terminate.
+PASS: database operations interrupted.
+
diff --git a/LayoutTests/fast/workers/storage/interrupt-database-sync.html b/LayoutTests/fast/workers/storage/interrupt-database-sync.html
new file mode 100644
index 0000000..deabee0
--- /dev/null
+++ b/LayoutTests/fast/workers/storage/interrupt-database-sync.html
@@ -0,0 +1,48 @@
+<html>
+<head>
+<script src="../resources/worker-util.js"></script>
+<script>
+var worker;
+
+function log(message)
+{
+    document.getElementById("console").innerHTML += message + "<br>";
+}
+
+function finishTest()
+{
+    log("PASS: database operations interrupted.");
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
+}
+
+function terminateWorker()
+{
+    worker.terminate();
+    waitUntilWorkerThreadsExit(finishTest)
+}
+
+function runTest()
+{
+    if (window.layoutTestController) {
+        layoutTestController.dumpAsText();
+        layoutTestController.waitUntilDone();
+    }
+
+    worker = new Worker('resources/interrupt-database-sync.js');
+    worker.onmessage = function(event) {
+        if (event.data == "terminate")
+            terminateWorker();
+        else
+            log(event.data);
+    };
+}
+</script>
+</head>
+
+<body onload="runTest()">
+This test makes sure that all sync database operations are immediately interrupted when the worker needs to terminate.
+<pre id="console">
+</pre>
+</body>
+</html>
diff --git a/LayoutTests/fast/workers/storage/interrupt-database.html b/LayoutTests/fast/workers/storage/interrupt-database.html
new file mode 100644
index 0000000..2ff4d45
--- /dev/null
+++ b/LayoutTests/fast/workers/storage/interrupt-database.html
@@ -0,0 +1,48 @@
+<html>
+<head>
+<script src="../resources/worker-util.js"></script>
+<script>
+var worker;
+
+function log(message)
+{
+    document.getElementById("console").innerHTML += message + "<br>";
+}
+
+function finishTest()
+{
+    log("PASS: database operations interrupted.");
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
+}
+
+function terminateWorker()
+{
+    worker.terminate();
+    waitUntilWorkerThreadsExit(finishTest)
+}
+
+function runTest()
+{
+    if (window.layoutTestController) {
+        layoutTestController.dumpAsText();
+        layoutTestController.waitUntilDone();
+    }
+
+    worker = new Worker('resources/interrupt-database.js');
+    worker.onmessage = function(event) {
+        if (event.data == "terminate")
+            terminateWorker();
+        else
+            log(event.data);
+    };
+}
+</script>
+</head>
+
+<body onload="runTest()">
+This test makes sure that all async database operations are immediately interrupted when the worker needs to terminate.
+<pre id="console">
+</pre>
+</body>
+</html>
diff --git a/LayoutTests/fast/workers/storage/resources/interrupt-database-sync.js b/LayoutTests/fast/workers/storage/resources/interrupt-database-sync.js
new file mode 100644
index 0000000..e533f08
--- /dev/null
+++ b/LayoutTests/fast/workers/storage/resources/interrupt-database-sync.js
@@ -0,0 +1,11 @@
+var db = openDatabaseSync("InterruptDatabaseSyncTest", "1", "", 1);
+db.transaction(function(tx) {
+    tx.executeSql("CREATE TABLE IF NOT EXISTS Test (Foo INT)");
+    var counter = 0;
+    while (true) {
+        // Put both statements on the same line, to make sure the exception is always reported on the same line.
+        tx.executeSql("INSERT INTO Test VALUES (1)"); tx.executeSql("DELETE FROM Test WHERE Foo = 1");
+        if (++counter == 100)
+            postMessage("terminate");
+    }
+});
diff --git a/LayoutTests/fast/workers/storage/resources/interrupt-database.js b/LayoutTests/fast/workers/storage/resources/interrupt-database.js
new file mode 100644
index 0000000..3f71a45
--- /dev/null
+++ b/LayoutTests/fast/workers/storage/resources/interrupt-database.js
@@ -0,0 +1,19 @@
+var counter = 0;
+function runTransaction()
+{
+    db.transaction(function(tx) {
+        tx.executeSql("INSERT INTO Test VALUES (1)");
+        tx.executeSql("DELETE FROM Test WHERE Foo = 1");
+        if (++counter == 100)
+            postMessage("terminate");
+    }, null, runTransaction);
+}
+
+var db = openDatabase("InterruptDatabaseTest", "1", "", 1);
+db.transaction(function(tx) {
+    tx.executeSql("CREATE TABLE IF NOT EXISTS Test (Foo INT)");
+}, function(error) {
+    postMessage("Error: " + error.message);
+}, function() {
+    runTransaction();
+});

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list