diff options
author | Kristian Monsen <kristianm@google.com> | 2010-05-21 16:53:46 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2010-05-25 10:24:15 +0100 |
commit | 6c2af9490927c3c5959b5cb07461b646f8b32f6c (patch) | |
tree | f7111b9b22befab472616c1d50ec94eb50f1ec8c /WebKitTools/Scripts/run-webkit-websocketserver | |
parent | a149172322a9067c14e8b474a53e63649aa17cad (diff) | |
download | external_webkit-6c2af9490927c3c5959b5cb07461b646f8b32f6c.zip external_webkit-6c2af9490927c3c5959b5cb07461b646f8b32f6c.tar.gz external_webkit-6c2af9490927c3c5959b5cb07461b646f8b32f6c.tar.bz2 |
Merge WebKit at r59636: Initial merge by git
Change-Id: I59b289c4e6b18425f06ce41cc9d34c522515de91
Diffstat (limited to 'WebKitTools/Scripts/run-webkit-websocketserver')
-rwxr-xr-x | WebKitTools/Scripts/run-webkit-websocketserver | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/WebKitTools/Scripts/run-webkit-websocketserver b/WebKitTools/Scripts/run-webkit-websocketserver index 06f9079..08d430b 100755 --- a/WebKitTools/Scripts/run-webkit-websocketserver +++ b/WebKitTools/Scripts/run-webkit-websocketserver @@ -47,7 +47,7 @@ my $webSocketPort = 8880; my $srcDir = sourceDir(); my $layoutTestsName = "$srcDir/LayoutTests"; my $testDirectory = File::Spec->rel2abs($layoutTestsName); -my $webSocketServerPID = 0; +my $webSocketServerPidFile = "$testDirectory/websocket.pid"; print "Starting Web Socket server...\n"; @@ -60,41 +60,29 @@ closeWebSocketServer(); print "Stopped.\n"; exit 0; - sub openWebSocketServer() { - my $webSocketServerPath = "/usr/bin/python"; - my $webSocketPythonPath = "$srcDir/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket"; my $webSocketHandlerDir = "$testDirectory"; - my $webSocketHandlerScanDir = "$testDirectory/websocket/tests"; - my $webSocketHandlerMapFile = "$webSocketHandlerScanDir/handler_map.txt"; my @args = ( - "$srcDir/WebKitTools/Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/standalone.py", - "--server-host", "127.0.0.1", + "$srcDir/WebKitTools/Scripts/new-run-webkit-websocketserver", + "--server", "start", "--port", "$webSocketPort", - "--document-root", "$webSocketHandlerDir", - "--scan-dir", "$webSocketHandlerScanDir", - "--websock-handlers-map-file", "$webSocketHandlerMapFile", - "--cgi-paths", "/websocket/tests", + "--root", "$webSocketHandlerDir", + "--pidfile", "$webSocketServerPidFile" ); - - $ENV{"PYTHONPATH"} = $webSocketPythonPath; - $webSocketServerPID = open2(\*WEBSOCKETSERVER_IN, \*WEBSOCKETSERVER_OUT, $webSocketServerPath, @args); - - my $listen = "http://127.0.0.1:$webSocketPort"; - my $retryCount = 10; - while (system("/usr/bin/curl -k -q --silent --stderr - --output /dev/null $listen") && $retryCount) { - sleep 1; - --$retryCount; - } - die "Timed out waiting for WebSocketServer to start" unless $retryCount; + system "/usr/bin/python", @args; } sub closeWebSocketServer() { - close WEBSOCKETSERVER_IN; - close WEBSOCKETSERVER_OUT; - kill 15, $webSocketServerPID; + my @args = ( + "$srcDir/WebKitTools/Scripts/new-run-webkit-websocketserver", + "--server", "stop", + "--pidfile", "$webSocketServerPidFile" + ); + system "/usr/bin/python", @args; + unlink "$webSocketServerPidFile"; } + |