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

ukai at chromium.org ukai at chromium.org
Wed Apr 7 23:21:47 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 12060d693b85e02656988cfd198afb815a63ba0b
Author: ukai at chromium.org <ukai at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 4 07:50:08 2009 +0000

    2009-11-03  Yuzo Fujishima  <yuzo at google.com>
    
            Reviewed by David Levin.
    
            Start/Stop Web Socket and Web Socket Secure servers for layout tests.
            https://bugs.webkit.org/show_bug.cgi?id=27491
    
            The test path determination logic is changed to handle websocket and websocket/ssl cases.
            The logic for non-http (and now also non-websocket) tests is moved toward the end of the if-elsif statement.
    
            Functions to start or stop Web Socket servers are added.
    
            * Scripts/run-webkit-tests:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50500 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 9b5b5f9..97df154 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,17 @@
+2009-11-03  Yuzo Fujishima  <yuzo at google.com>
+
+        Reviewed by David Levin.
+
+        Start/Stop Web Socket and Web Socket Secure servers for layout tests.
+        https://bugs.webkit.org/show_bug.cgi?id=27491
+
+        The test path determination logic is changed to handle websocket and websocket/ssl cases.
+        The logic for non-http (and now also non-websocket) tests is moved toward the end of the if-elsif statement.
+
+        Functions to start or stop Web Socket servers are added.
+
+        * Scripts/run-webkit-tests:
+
 2009-11-03  Eric Seidel  <eric at webkit.org>
 
         No review, just changing wording of log message.
diff --git a/WebKitTools/Scripts/run-webkit-tests b/WebKitTools/Scripts/run-webkit-tests
index 6056035..e14fec5 100755
--- a/WebKitTools/Scripts/run-webkit-tests
+++ b/WebKitTools/Scripts/run-webkit-tests
@@ -76,6 +76,7 @@ sub buildPlatformTestHierarchy(@);
 sub closeCygpaths();
 sub closeDumpTool();
 sub closeHTTPD();
+sub closeWebSocketServer();
 sub countAndPrintLeaks($$$);
 sub countFinishedTest($$$$);
 sub deleteExpectedAndActualResults($);
@@ -91,6 +92,7 @@ sub openDiffTool();
 sub openDumpTool();
 sub openHTTPDIfNeeded();
 sub parseLeaksandPrintUniqueLeaks();
+sub openWebSocketServerIfNeeded();
 sub pathcmp($$);
 sub printFailureMessageForTest($$);
 sub processIgnoreTests($$);
@@ -117,6 +119,8 @@ my $guardMalloc = '';
 my $httpdPort = 8000;
 my $httpdSSLPort = 8443;
 my $ignoreMetrics = 0;
+my $webSocketPort = 8880;
+my $webSocketSecurePort = 9323;
 my $ignoreTests = '';
 my $iterations = 1;
 my $launchSafari = 1;
@@ -485,6 +489,9 @@ my $atLineStart = 1;
 my $lastDirectory = "";
 
 my $isHttpdOpen = 0;
+my $isWebSocketServerOpen = 0;
+my $webSocketServerPID = 0;
+my $webSocketSecureServerPID = 0;
 
 sub catch_pipe { $dumpToolCrashed = 1; }
 $SIG{"PIPE"} = "catch_pipe";
@@ -577,15 +584,7 @@ for my $test (@tests) {
         }
     }
 
-    if ($test !~ /^http\//) {
-        my $testPath = "$testDirectory/$test";
-        if (isCygwin()) {
-            $testPath = toWindowsPath($testPath);
-        } else {
-            $testPath = canonpath($testPath);
-        }
-        print OUT "$testPath$suffixExpectedHash\n";
-    } else {
+    if ($test =~ /^http\//) {
         openHTTPDIfNeeded();
         if ($test !~ /^http\/tests\/local\// && $test !~ /^http\/tests\/ssl\// && $test !~ /^http\/tests\/wml\// && $test !~ /^http\/tests\/media\//) {
             my $path = canonpath($test);
@@ -604,6 +603,32 @@ for my $test (@tests) {
             }
             print OUT "$testPath$suffixExpectedHash\n";
         }
+    } elsif ($test =~ /^websocket\//) {
+        if ($test =~ /^websocket\/tests\/local\//) {
+            my $testPath = "$testDirectory/$test";
+            if (isCygwin()) {
+                $testPath = toWindowsPath($testPath);
+            } else {
+                $testPath = canonpath($testPath);
+            }
+            print OUT "$testPath\n";
+        } else {
+            openWebSocketServerIfNeeded();
+            my $path = canonpath($test);
+            if ($test =~ /^websocket\/tests\/ssl\//) {
+                print OUT "https://127.0.0.1:$webSocketSecurePort/$path\n";
+            } else {
+                print OUT "http://127.0.0.1:$webSocketPort/$path\n";
+            }
+        }
+    } else {
+        my $testPath = "$testDirectory/$test";
+        if (isCygwin()) {
+            $testPath = toWindowsPath($testPath);
+        } else {
+            $testPath = canonpath($testPath);
+        }
+        print OUT "$testPath$suffixExpectedHash\n";
     }
 
     # DumpRenderTree is expected to dump two "blocks" to stdout for each test.
@@ -892,6 +917,7 @@ printf "\n%0.2fs total testing time\n", (time - $overallStartTime) . "";
 !$isDumpToolOpen || die "Failed to close $dumpToolName.\n";
 
 closeHTTPD();
+closeWebSocketServer();
 
 # Because multiple instances of this script are running concurrently we cannot 
 # safely delete this symlink.
@@ -1373,6 +1399,64 @@ sub closeHTTPD()
     $isHttpdOpen = 0;
 }
 
+sub openWebSocketServerIfNeeded()
+{
+    return if $isWebSocketServerOpen;
+
+    my $webSocketServerPath = "/usr/bin/python";
+    my $webSocketPythonPath = "WebKitTools/pywebsocket";
+    my $webSocketHandlerDir = "$testDirectory";
+    my $webSocketHandlerScanDir = "$testDirectory/websocket/tests";
+    my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem";
+    my @args = (
+        "WebKitTools/pywebsocket/mod_pywebsocket/standalone.py",
+        "-p", "$webSocketPort",
+        "-d", "$webSocketHandlerDir",
+        "-s", "$webSocketHandlerScanDir",
+    );
+    my @argsSecure = (
+        "WebKitTools/pywebsocket/mod_pywebsocket/standalone.py",
+        "-p", "$webSocketSecurePort",
+        "-d", "$webSocketHandlerDir",
+        "-t",
+        "-k", "$sslCertificate",
+        "-c", "$sslCertificate",
+    );
+
+    $ENV{"PYTHONPATH"} = $webSocketPythonPath;
+    $webSocketServerPID = open3(\*WEBSOCKETSERVER_IN, \*WEBSOCKETSERVER_OUT, \*WEBSOCKETSERVER_ERR, $webSocketServerPath, @args);
+    $webSocketSecureServerPID = open3(\*WEBSOCKETSECURESERVER_IN, \*WEBSOCKETSECURESERVER_OUT, \*WEBSOCKETSECURESERVER_ERR, $webSocketServerPath, @argsSecure);
+
+    my @listen = ("http://127.0.0.1:$webSocketPort", "https://127.0.0.1:$webSocketSecurePort");
+    for (my $i = 0; $i < @listen; $i++) {
+        my $retryCount = 10;
+        while (system("/usr/bin/curl -k -q --silent --stderr - --output /dev/null $listen[$i]") && $retryCount) {
+            sleep 1;
+            --$retryCount;
+        }
+        die "Timed out waiting for WebSocketServer to start" unless $retryCount;
+    }
+
+    $isWebSocketServerOpen = 1;
+}
+
+sub closeWebSocketServer()
+{
+    return if !$isWebSocketServerOpen;
+
+    close WEBSOCKETSERVER_IN;
+    close WEBSOCKETSERVER_OUT;
+    close WEBSOCKETSERVER_ERR;
+    kill 15, $webSocketServerPID;
+
+    close WEBSOCKETSECURESERVER_IN;
+    close WEBSOCKETSECURESERVER_OUT;
+    close WEBSOCKETSECURESERVER_ERR;
+    kill 15, $webSocketSecureServerPID;
+
+    $isWebSocketServerOpen = 0;
+}
+
 sub fileNameWithNumber($$)
 {
     my ($base, $number) = @_;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list