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

michaeln at google.com michaeln at google.com
Wed Dec 22 15:25:09 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 09ddad6ba018d068da214130609dca4aa9a1730c
Author: michaeln at google.com <michaeln at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 3 01:07:40 2010 +0000

    2010-11-02  Michael Nordman  <michaeln at google.com>
    
            Reviewed by Alexey Proskuryakov.
    
            [Chromium] Some work on making appcache layout tests less flaky.
            https://bugs.webkit.org/show_bug.cgi?id=48002
            1) Make network-simulator.php less slow.
            In addition to redirecting back to the requested url, the response contains
            multiple content-length headers. Chrome's network stacks considers that an
            error condition too and picks up on it faster (one round trip instead of multiple).
            This avoids timeouts due to using PHP via slow CGI on windows.
            2) Removed canLoad() from appcache/fallback.html layout test, the load()
            result is sufficient for determining if it could be loaded. So fewer requests are
            made to conduct the test, cutting out more time.
            3) Removed some unneeded code from offline-access-frame.html. Appcache events are guaranteed
            to be deferred until after 'onload' has happened. This test was coded prior to that
            guarantee being satisfied.
    
            * http/tests/appcache/fallback.html:
            * http/tests/resources/network-simulator.php:
            * http/tests/resources/offline-access-frame.html:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71196 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ee24049..cef845d 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,25 @@
+2010-11-02  Michael Nordman  <michaeln at google.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        [Chromium] Some work on making appcache layout tests less flaky.
+        https://bugs.webkit.org/show_bug.cgi?id=48002
+        1) Make network-simulator.php less slow.
+        In addition to redirecting back to the requested url, the response contains
+        multiple content-length headers. Chrome's network stacks considers that an
+        error condition too and picks up on it faster (one round trip instead of multiple).
+        This avoids timeouts due to using PHP via slow CGI on windows.
+        2) Removed canLoad() from appcache/fallback.html layout test, the load()
+        result is sufficient for determining if it could be loaded. So fewer requests are
+        made to conduct the test, cutting out more time.
+        3) Removed some unneeded code from offline-access-frame.html. Appcache events are guaranteed
+        to be deferred until after 'onload' has happened. This test was coded prior to that
+        guarantee being satisfied.
+
+        * http/tests/appcache/fallback.html:
+        * http/tests/resources/network-simulator.php:
+        * http/tests/resources/offline-access-frame.html:
+
 2010-11-02  Mihai Parparita  <mihaip at chromium.org>
         
         Update the pixel expectations for fast/canvas, fast/css-generated-content, fast/inline-block, fast/inline, and fast/overflow for the Mac port.
diff --git a/LayoutTests/http/tests/appcache/fallback.html b/LayoutTests/http/tests/appcache/fallback.html
index aaf7a82..ed641e0 100644
--- a/LayoutTests/http/tests/appcache/fallback.html
+++ b/LayoutTests/http/tests/appcache/fallback.html
@@ -29,18 +29,6 @@ function setNetworkEnabled(state)
     }
 }
 
-function canLoad(url)
-{
-    try {
-        var req = new XMLHttpRequest();
-        req.open("GET", url, false);
-        req.send("");
-        return true;
-    } catch (e) {
-        return false;
-    }
-}
-
 function load(url)
 {
     try {
@@ -49,8 +37,9 @@ function load(url)
         req.send("");
         return req.responseText;
     } catch (ex) {
-        alert("Unexpected error loading " + url + ": " + ex);
+        log("FAIL: Cannot load " + url + ", ex = " + ex);
         hadError = true;
+        return ""; // This value should not be expected as the responseText for a url presented to this function.
     }
 }
 
@@ -65,17 +54,17 @@ function test()
     
     setNetworkEnabled(true);
 
-    if (!canLoad(testURL) || !/not in the cache/.test(load(testURL))) {
+    if (!/not in the cache/.test(load(testURL))) {
         log("FAIL: Cannot load an URL from fallback namespace when network is enabled");
         hadError = true;
     }
 
-    if (!canLoad(nonexistentURL) || load(nonexistentURL) != "Hello, World!") {
+    if (load(nonexistentURL) != "Hello, World!") {
         log("FAIL: Fallback resource wasn't used for a 404 response");
         hadError = true;
     }
 
-    if (!canLoad(redirectURL) || load(redirectURL) != "Hello, World!") {
+    if (load(redirectURL) != "Hello, World!") {
         log("FAIL: Fallback resource wasn't used for a redirect to a resource with another origin");
         hadError = true;
     }
@@ -147,10 +136,7 @@ function test6()
 {
     setNetworkEnabled(false);
 
-    if (!canLoad(testURL)) {
-        log("FAIL: Cannot load an URL from fallback namespace when network is disabled");
-        hadError = true;
-    } else if (load(testURL) != load("resources/simple.txt")) {
+    if (load(testURL) != load("resources/simple.txt")) {
         log("FAIL: Loading an URL from fallback namespace when network is disabled returned unexpected response");
         hadError = true;
     }
diff --git a/LayoutTests/http/tests/appcache/resources/offline-access-frame.html b/LayoutTests/http/tests/appcache/resources/offline-access-frame.html
index 68ef274..43015ae 100644
--- a/LayoutTests/http/tests/appcache/resources/offline-access-frame.html
+++ b/LayoutTests/http/tests/appcache/resources/offline-access-frame.html
@@ -17,14 +17,5 @@ applicationCache.onobsolete = function() { log("obsolete") }
 applicationCache.oncached = function() { log("cached"); test() }
 applicationCache.onnoupdate = function() { log("noupdate"); test() }
 applicationCache.onerror = function() { log("error"); test() }
-
-if (applicationCache.status == applicationCache.IDLE) {
-    // Update finished while we were waiting for offline-access.js to load.
-    applicationCache.oncached = function() { log("cached") }
-    applicationCache.onnoupdate = function() { log("noupdate") }
-    applicationCache.onerror = function() { log("error") }
-    test();
-}
-
 </script>
 </html>
diff --git a/LayoutTests/http/tests/resources/network-simulator.php b/LayoutTests/http/tests/resources/network-simulator.php
index 4860028..ccfcf5c 100644
--- a/LayoutTests/http/tests/resources/network-simulator.php
+++ b/LayoutTests/http/tests/resources/network-simulator.php
@@ -2,7 +2,7 @@
 require_once 'portabilityLayer.php';
 
 // This script acts as a stateful proxy for retrieving files. When the state is set to
-// offline, it simulates a network error by redirecting to itself.
+// offline, it simulates a network error with a nonsense response.
 
 if (!sys_get_temp_dir()) {
     echo "FAIL: No temp dir was returned.\n";
@@ -59,9 +59,12 @@ function generateResponse($path)
     global $stateFile;
     $state = getState($stateFile);
     if ($state == "Offline") {
+        # Simulate a network error by replying with a nonsense response.
         header('HTTP/1.1 307 Temporary Redirect');
-        # Simulate a network error by redirecting to self.
-        header('Location: ' . $_SERVER['REQUEST_URI']);
+        header('Location: ' . $_SERVER['REQUEST_URI']); # Redirect to self.
+        header('Content-Length: 1');
+        header('Content-Length: 5', false); # Multiple content-length headers, some network stacks can detect this condition faster.
+        echo "Intentionally incorrect response.";
     } else {
         // A little securuty checking can't hurt.
         if (strstr($path, ".."))
@@ -70,7 +73,7 @@ function generateResponse($path)
         if ($path[0] == '/')
             $path = '..' . $path;
 
-        generateNoCacheHTTPHeader();    
+        generateNoCacheHTTPHeader();
 
         if (file_exists($path)) {
             header("Last-Modified: " . gmdate("D, d M Y H:i:s T", filemtime($path)));

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list