From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- .../tests/tools/pywebsocket/src/COPYING | 28 + .../tests/tools/pywebsocket/src/MANIFEST.in | 6 + .../tests/tools/pywebsocket/src/README | 17 + .../pywebsocket/src/example/abort_handshake_wsh.py | 43 + .../tools/pywebsocket/src/example/abort_wsh.py | 43 + .../src/example/arraybuffer_benchmark.html | 134 ++ .../tools/pywebsocket/src/example/bench_wsh.py | 60 + .../tools/pywebsocket/src/example/benchmark.html | 203 ++ .../tools/pywebsocket/src/example/benchmark.js | 309 +++ .../src/example/benchmark_helper_wsh.py | 85 + .../tools/pywebsocket/src/example/close_wsh.py | 69 + .../tools/pywebsocket/src/example/console.html | 317 +++ .../tools/pywebsocket/src/example/cookie_wsh.py | 32 + .../tools/pywebsocket/src/example/echo_client.py | 1128 +++++++++++ .../pywebsocket/src/example/echo_noext_wsh.py | 61 + .../tools/pywebsocket/src/example/echo_wsh.py | 54 + .../tools/pywebsocket/src/example/eventsource.cgi | 54 + .../tools/pywebsocket/src/example/eventsource.html | 74 + .../tools/pywebsocket/src/example/handler_map.txt | 11 + .../tools/pywebsocket/src/example/hsts_wsh.py | 40 + .../pywebsocket/src/example/internal_error_wsh.py | 42 + .../pywebsocket/src/example/origin_check_wsh.py | 44 + .../tools/pywebsocket/src/example/pywebsocket.conf | 42 + .../pywebsocket/src/example/special_headers.cgi | 28 + .../tests/tools/pywebsocket/src/example/util.js | 177 ++ .../tools/pywebsocket/src/example/util_main.js | 63 + .../tools/pywebsocket/src/example/util_worker.js | 19 + .../pywebsocket/src/example/xhr_benchmark.html | 222 +++ .../tools/pywebsocket/src/example/xhr_benchmark.js | 389 ++++ .../pywebsocket/src/example/xhr_event_logger.html | 110 ++ .../pywebsocket/src/mod_pywebsocket/__init__.py | 224 +++ .../src/mod_pywebsocket/_stream_base.py | 181 ++ .../src/mod_pywebsocket/_stream_hixie75.py | 229 +++ .../src/mod_pywebsocket/_stream_hybi.py | 887 +++++++++ .../pywebsocket/src/mod_pywebsocket/common.py | 303 +++ .../pywebsocket/src/mod_pywebsocket/dispatch.py | 393 ++++ .../pywebsocket/src/mod_pywebsocket/extensions.py | 885 +++++++++ .../pywebsocket/src/mod_pywebsocket/fast_masking.i | 98 + .../src/mod_pywebsocket/handshake/__init__.py | 110 ++ .../src/mod_pywebsocket/handshake/_base.py | 182 ++ .../src/mod_pywebsocket/handshake/hybi.py | 420 ++++ .../src/mod_pywebsocket/handshake/hybi00.py | 293 +++ .../src/mod_pywebsocket/headerparserhandler.py | 254 +++ .../src/mod_pywebsocket/http_header_util.py | 263 +++ .../src/mod_pywebsocket/memorizingfile.py | 99 + .../pywebsocket/src/mod_pywebsocket/msgutil.py | 219 ++ .../tools/pywebsocket/src/mod_pywebsocket/mux.py | 1889 ++++++++++++++++++ .../pywebsocket/src/mod_pywebsocket/standalone.py | 1193 +++++++++++ .../pywebsocket/src/mod_pywebsocket/stream.py | 57 + .../tools/pywebsocket/src/mod_pywebsocket/util.py | 416 ++++ .../src/mod_pywebsocket/xhr_benchmark_handler.py | 109 + .../tests/tools/pywebsocket/src/setup.py | 74 + .../tests/tools/pywebsocket/src/test/__init__.py | 0 .../tools/pywebsocket/src/test/cert/cacert.pem | 17 + .../tests/tools/pywebsocket/src/test/cert/cert.pem | 61 + .../pywebsocket/src/test/cert/client_cert.p12 | Bin 0 -> 2582 bytes .../tests/tools/pywebsocket/src/test/cert/key.pem | 15 + .../pywebsocket/src/test/client_for_testing.py | 1100 +++++++++++ .../src/test/endtoend_with_external_server.py | 67 + .../tests/tools/pywebsocket/src/test/mock.py | 221 +++ .../pywebsocket/src/test/mux_client_for_testing.py | 690 +++++++ .../tests/tools/pywebsocket/src/test/run_all.py | 89 + .../tools/pywebsocket/src/test/set_sys_path.py | 45 + .../tools/pywebsocket/src/test/test_dispatch.py | 288 +++ .../tools/pywebsocket/src/test/test_endtoend.py | 753 +++++++ .../tools/pywebsocket/src/test/test_extensions.py | 360 ++++ .../tools/pywebsocket/src/test/test_handshake.py | 188 ++ .../pywebsocket/src/test/test_handshake_hybi.py | 534 +++++ .../pywebsocket/src/test/test_handshake_hybi00.py | 516 +++++ .../pywebsocket/src/test/test_http_header_util.py | 90 + .../pywebsocket/src/test/test_memorizingfile.py | 104 + .../tests/tools/pywebsocket/src/test/test_mock.py | 145 ++ .../tools/pywebsocket/src/test/test_msgutil.py | 1356 +++++++++++++ .../tests/tools/pywebsocket/src/test/test_mux.py | 2089 ++++++++++++++++++++ .../tools/pywebsocket/src/test/test_stream.py | 77 + .../pywebsocket/src/test/test_stream_hixie75.py | 59 + .../tests/tools/pywebsocket/src/test/test_util.py | 200 ++ .../tools/pywebsocket/src/test/testdata/README | 1 + .../test/testdata/handlers/abort_by_user_wsh.py | 42 + .../src/test/testdata/handlers/blank_wsh.py | 31 + .../src/test/testdata/handlers/origin_check_wsh.py | 42 + .../handlers/sub/exception_in_transfer_wsh.py | 44 + .../testdata/handlers/sub/no_wsh_at_the_end.py | 45 + .../test/testdata/handlers/sub/non_callable_wsh.py | 39 + .../src/test/testdata/handlers/sub/plain_wsh.py | 40 + .../handlers/sub/wrong_handshake_sig_wsh.py | 45 + .../handlers/sub/wrong_transfer_sig_wsh.py | 45 + .../tools/pywebsocket/src/test/testdata/hello.pl | 32 + 88 files changed, 22152 insertions(+) create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/COPYING create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/MANIFEST.in create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/README create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/abort_handshake_wsh.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/abort_wsh.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/arraybuffer_benchmark.html create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/bench_wsh.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/benchmark.html create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/benchmark.js create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/benchmark_helper_wsh.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/close_wsh.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/console.html create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/cookie_wsh.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/example/echo_client.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/echo_noext_wsh.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/echo_wsh.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/example/eventsource.cgi create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/eventsource.html create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/handler_map.txt create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/hsts_wsh.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/internal_error_wsh.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/origin_check_wsh.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/pywebsocket.conf create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/example/special_headers.cgi create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/util.js create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/util_main.js create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/util_worker.js create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/xhr_benchmark.html create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/xhr_benchmark.js create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/example/xhr_event_logger.html create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/__init__.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/_stream_base.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/_stream_hixie75.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/_stream_hybi.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/common.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/dispatch.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/extensions.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/fast_masking.i create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/handshake/__init__.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/handshake/_base.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/handshake/hybi.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/handshake/hybi00.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/headerparserhandler.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/http_header_util.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/memorizingfile.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/msgutil.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/mux.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/standalone.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/stream.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/util.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/xhr_benchmark_handler.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/setup.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/__init__.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/cert/cacert.pem create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/cert/cert.pem create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/cert/client_cert.p12 create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/cert/key.pem create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/client_for_testing.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/test/endtoend_with_external_server.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/mock.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/mux_client_for_testing.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/test/run_all.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/set_sys_path.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/test/test_dispatch.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/test/test_endtoend.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/test/test_extensions.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/test/test_handshake.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/test/test_handshake_hybi.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/test/test_handshake_hybi00.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/test/test_http_header_util.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/test/test_memorizingfile.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/test/test_mock.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/test/test_msgutil.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/test_mux.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/test/test_stream.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/test/test_stream_hixie75.py create mode 100755 testing/web-platform/tests/tools/pywebsocket/src/test/test_util.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/testdata/README create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/testdata/handlers/abort_by_user_wsh.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/testdata/handlers/blank_wsh.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/testdata/handlers/origin_check_wsh.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/testdata/handlers/sub/exception_in_transfer_wsh.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/testdata/handlers/sub/no_wsh_at_the_end.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/testdata/handlers/sub/non_callable_wsh.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/testdata/handlers/sub/plain_wsh.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/testdata/handlers/sub/wrong_handshake_sig_wsh.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/testdata/handlers/sub/wrong_transfer_sig_wsh.py create mode 100644 testing/web-platform/tests/tools/pywebsocket/src/test/testdata/hello.pl (limited to 'testing/web-platform/tests/tools/pywebsocket/src') diff --git a/testing/web-platform/tests/tools/pywebsocket/src/COPYING b/testing/web-platform/tests/tools/pywebsocket/src/COPYING new file mode 100644 index 000000000..989d02e4c --- /dev/null +++ b/testing/web-platform/tests/tools/pywebsocket/src/COPYING @@ -0,0 +1,28 @@ +Copyright 2012, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/testing/web-platform/tests/tools/pywebsocket/src/MANIFEST.in b/testing/web-platform/tests/tools/pywebsocket/src/MANIFEST.in new file mode 100644 index 000000000..19256882c --- /dev/null +++ b/testing/web-platform/tests/tools/pywebsocket/src/MANIFEST.in @@ -0,0 +1,6 @@ +include COPYING +include MANIFEST.in +include README +recursive-include example *.py +recursive-include mod_pywebsocket *.py +recursive-include test *.py diff --git a/testing/web-platform/tests/tools/pywebsocket/src/README b/testing/web-platform/tests/tools/pywebsocket/src/README new file mode 100644 index 000000000..c8c758f5e --- /dev/null +++ b/testing/web-platform/tests/tools/pywebsocket/src/README @@ -0,0 +1,17 @@ +INSTALL + +To install this package to the system, run this: +$ python setup.py build +$ sudo python setup.py install + +To install this package as a normal user, run this instead: +$ python setup.py build +$ python setup.py install --user + +LAUNCH + +To use pywebsocket as Apache module, run this to read the document: +$ pydoc mod_pywebsocket + +To use pywebsocket as standalone server, run this to read the document: +$ pydoc mod_pywebsocket.standalone diff --git a/testing/web-platform/tests/tools/pywebsocket/src/example/abort_handshake_wsh.py b/testing/web-platform/tests/tools/pywebsocket/src/example/abort_handshake_wsh.py new file mode 100644 index 000000000..008023a1f --- /dev/null +++ b/testing/web-platform/tests/tools/pywebsocket/src/example/abort_handshake_wsh.py @@ -0,0 +1,43 @@ +# Copyright 2012, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +from mod_pywebsocket import handshake + + +def web_socket_do_extra_handshake(request): + raise handshake.AbortedByUserException( + "Aborted in web_socket_do_extra_handshake") + + +def web_socket_transfer_data(request): + pass + + +# vi:sts=4 sw=4 et diff --git a/testing/web-platform/tests/tools/pywebsocket/src/example/abort_wsh.py b/testing/web-platform/tests/tools/pywebsocket/src/example/abort_wsh.py new file mode 100644 index 000000000..2bbf005f6 --- /dev/null +++ b/testing/web-platform/tests/tools/pywebsocket/src/example/abort_wsh.py @@ -0,0 +1,43 @@ +# Copyright 2012, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +from mod_pywebsocket import handshake + + +def web_socket_do_extra_handshake(request): + pass + + +def web_socket_transfer_data(request): + raise handshake.AbortedByUserException( + "Aborted in web_socket_transfer_data") + + +# vi:sts=4 sw=4 et diff --git a/testing/web-platform/tests/tools/pywebsocket/src/example/arraybuffer_benchmark.html b/testing/web-platform/tests/tools/pywebsocket/src/example/arraybuffer_benchmark.html new file mode 100644 index 000000000..869cd7e1e --- /dev/null +++ b/testing/web-platform/tests/tools/pywebsocket/src/example/arraybuffer_benchmark.html @@ -0,0 +1,134 @@ + + + + +ArrayBuffer benchmark + + + + + + + diff --git a/testing/web-platform/tests/tools/pywebsocket/src/example/bench_wsh.py b/testing/web-platform/tests/tools/pywebsocket/src/example/bench_wsh.py new file mode 100644 index 000000000..5067ca7d8 --- /dev/null +++ b/testing/web-platform/tests/tools/pywebsocket/src/example/bench_wsh.py @@ -0,0 +1,60 @@ +# Copyright 2011, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +"""A simple load tester for WebSocket clients. + +A client program sends a message formatted as "