summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/websockets/handlers/passive-close-abort_wsh.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/websockets/handlers/passive-close-abort_wsh.py')
-rw-r--r--testing/web-platform/tests/websockets/handlers/passive-close-abort_wsh.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/testing/web-platform/tests/websockets/handlers/passive-close-abort_wsh.py b/testing/web-platform/tests/websockets/handlers/passive-close-abort_wsh.py
new file mode 100644
index 0000000000..ac3f67c8db
--- /dev/null
+++ b/testing/web-platform/tests/websockets/handlers/passive-close-abort_wsh.py
@@ -0,0 +1,24 @@
+# Copyright (c) 2024 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+Wait for a Close frame from the client and then close the connection without
+sending a Close frame in return.
+"""
+
+from mod_pywebsocket.handshake import AbortedByUserException
+
+
+def web_socket_do_extra_handshake(request):
+ pass
+
+
+def web_socket_transfer_data(request):
+ while True:
+ if request.ws_stream.receive_message() is None:
+ return
+
+
+def web_socket_passive_closing_handshake(request):
+ raise AbortedByUserException('abrupt close')