[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

dimich at chromium.org dimich at chromium.org
Thu Apr 8 02:19:43 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 8112f8f3e3c458ec63e5fceac981b029f9c42af8
Author: dimich at chromium.org <dimich at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Mar 11 23:14:15 2010 +0000

    Make appcache layouttests top-frame-*.html more robust for async checking event
    https://bugs.webkit.org/show_bug.cgi?id=32047
    
    Reviewed by Alexey Proskuryakov.
    
    Modified the tests to watch for all termination conditions, eliminating the hardcoded
    assumed order of the events from separate async event sources.
    Also added check for "noupdate" event.
    
    * http/tests/appcache/top-frame-2.html: Modified to be consistent with the other 2 tests.
    * http/tests/appcache/top-frame-3-expected.txt:
    * http/tests/appcache/top-frame-3.html: Used logic similar to top-frame-2.html to avoid assumption of the events order.
    * http/tests/appcache/top-frame-4-expected.txt:
    * http/tests/appcache/top-frame-4.html: Ditto.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55858 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a009f86..eae2790 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2010-03-11  Dmitry Titov  <dimich at chromium.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Make appcache layouttests top-frame-*.html more robust for async checking event
+        https://bugs.webkit.org/show_bug.cgi?id=32047
+
+        Modified the tests to watch for all termination conditions, eliminating the hardcoded
+        assumed order of the events from separate async event sources.
+        Also added check for "noupdate" event.
+
+        * http/tests/appcache/top-frame-2.html: Modified to be consistent with the other 2 tests.
+        * http/tests/appcache/top-frame-3-expected.txt:
+        * http/tests/appcache/top-frame-3.html: Used logic similar to top-frame-2.html to avoid assumption of the events order.
+        * http/tests/appcache/top-frame-4-expected.txt:
+        * http/tests/appcache/top-frame-4.html: Ditto.
+
 2010-03-11  Martin Robinson  <mrobinson at webkit.org>
 
         Reviewed by Adam Barth
diff --git a/LayoutTests/http/tests/appcache/top-frame-2.html b/LayoutTests/http/tests/appcache/top-frame-2.html
index edde8c2..71bd468 100644
--- a/LayoutTests/http/tests/appcache/top-frame-2.html
+++ b/LayoutTests/http/tests/appcache/top-frame-2.html
@@ -27,6 +27,15 @@ var receivedExpectedMessage = false;
 var receivedCheckingEvent = false;
 var receivedNoupdateEvent = false;
 
+function checkDone()
+{
+    if (receivedExpectedMessage && receivedCheckingEvent && receivedNoupdateEvent) {
+        log("SUCCESS");
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    }
+}
+
 function test()
 {
     applicationCache.onnoupdate = null;
@@ -41,15 +50,6 @@ function test()
     document.body.appendChild(ifr);
 }
 
-function checkDone()
-{
-    if (receivedExpectedMessage && receivedCheckingEvent && receivedNoupdateEvent) {
-        log("SUCCESS");
-        if (window.layoutTestController)
-            layoutTestController.notifyDone();
-    }
-}
-
 applicationCache.onnoupdate = function() { test() }
 applicationCache.oncached = function() { test() }
 
diff --git a/LayoutTests/http/tests/appcache/top-frame-3-expected.txt b/LayoutTests/http/tests/appcache/top-frame-3-expected.txt
index a10dbee..a1245cb 100644
--- a/LayoutTests/http/tests/appcache/top-frame-3-expected.txt
+++ b/LayoutTests/http/tests/appcache/top-frame-3-expected.txt
@@ -4,7 +4,5 @@ In this case, the subframe resource is NOT listed in manifest explicitly.
 
 Should say SUCCESS:
 
-checking
-checking
 SUCCESS
 
diff --git a/LayoutTests/http/tests/appcache/top-frame-3.html b/LayoutTests/http/tests/appcache/top-frame-3.html
index 9fc9dde..a2d2cc6 100644
--- a/LayoutTests/http/tests/appcache/top-frame-3.html
+++ b/LayoutTests/http/tests/appcache/top-frame-3.html
@@ -16,13 +16,34 @@ function log(message)
     document.getElementById("result").innerHTML += message + "<br>";
 }
 
+function debug(message)
+{
+    // If running manually in the browser, print the sequence of events.
+    if (!window.layoutTestController)
+        log(message);
+}
+
+var receivedExpectedMessage = false;
+var receivedCheckingEventsCounter = 0;
+var receivedNoupdateEventsCounter = 0;
+
+function checkDone()
+{
+    if (receivedExpectedMessage && receivedCheckingEventsCounter == 2 && receivedNoupdateEventsCounter == 2) {
+        log("SUCCESS");
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    }
+}
+
 function test()
 {
     applicationCache.onnoupdate = null;
     applicationCache.oncached = null;
 
     // When a new main resource is associated with the cache, an update should be started.
-    applicationCache.onchecking = function() { log("checking") }
+    applicationCache.onchecking = function() { debug("checking"); receivedCheckingEventsCounter++; checkDone() }
+    applicationCache.onnoupdate = function() { debug("noupdate"); receivedNoupdateEventsCounter++; checkDone();  }
 
     var ifr = document.createElement("iframe");
     ifr.setAttribute("src", "resources/subframe-3.html");
@@ -42,9 +63,9 @@ function test2()
 
 function test3()
 {
-    log("SUCCESS");
-    if (window.layoutTestController)
-        layoutTestController.notifyDone();
+    debug("message");
+    receivedExpectedMessage = true;
+    checkDone();
 }
 
 applicationCache.onnoupdate = function() { test() }
diff --git a/LayoutTests/http/tests/appcache/top-frame-4-expected.txt b/LayoutTests/http/tests/appcache/top-frame-4-expected.txt
index 43bfd43..e748160 100644
--- a/LayoutTests/http/tests/appcache/top-frame-4-expected.txt
+++ b/LayoutTests/http/tests/appcache/top-frame-4-expected.txt
@@ -4,7 +4,5 @@ In this case, the subframe resource is listed in manifest explicitly.
 
 Should say SUCCESS:
 
-checking
-checking
 SUCCESS
 
diff --git a/LayoutTests/http/tests/appcache/top-frame-4.html b/LayoutTests/http/tests/appcache/top-frame-4.html
index 39743b9..c36e0a3 100644
--- a/LayoutTests/http/tests/appcache/top-frame-4.html
+++ b/LayoutTests/http/tests/appcache/top-frame-4.html
@@ -16,13 +16,34 @@ function log(message)
     document.getElementById("result").innerHTML += message + "<br>";
 }
 
+function debug(message)
+{
+    // If running manually in the browser, print the sequence of events.
+    if (!window.layoutTestController)
+        log(message);
+}
+
+var receivedExpectedMessage = false;
+var receivedCheckingEventsCounter = 0;
+var receivedNoupdateEventsCounter = 0;
+
+function checkDone()
+{
+    if (receivedExpectedMessage && receivedCheckingEventsCounter == 2 && receivedNoupdateEventsCounter == 2) {
+        log("SUCCESS");
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    }
+}
+
 function test()
 {
     applicationCache.onnoupdate = null;
     applicationCache.oncached = null;
 
     // When a new main resource is associated with the cache, an update should be started.
-    applicationCache.onchecking = function() { log("checking") }
+    applicationCache.onchecking = function() { debug("checking"); receivedCheckingEventsCounter++; checkDone() }
+    applicationCache.onnoupdate = function() { debug("noupdate"); receivedNoupdateEventsCounter++; checkDone();  }
 
     var ifr = document.createElement("iframe");
     ifr.setAttribute("src", "resources/subframe-4.html");
@@ -42,9 +63,9 @@ function test2()
 
 function test3()
 {
-    log("SUCCESS");
-    if (window.layoutTestController)
-        layoutTestController.notifyDone();
+    debug("message");
+    receivedExpectedMessage = true;
+    checkDone();
 }
 
 applicationCache.onnoupdate = function() { test() }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list