Skip to content

Commit

Permalink
Stop sending 2 Close frames from client-close_wsh
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=265209
rdar://problem/118889240

Reviewed by Alexey Proskuryakov.

Merge: https://chromium.googlesource.com/chromium/blink/+/2138625fb49a80512464cf45fc1244015054c8de

client-close_wsh.py generates one Close frame directly, and then pywebsocket sends
another one. Tell pywebsocket that the Close frame has already been sent.

* LayoutTests/http/tests/websocket/tests/hybi/client-close_wsh.py:
* LayoutTests/platform/ios-wk2/TestExpectations: Remove Test-specific Expectation
* LayoutTests/platform/mac-wk1/TestExpectations: Ditto

Canonical link: https://commits.webkit.org/271447@main
  • Loading branch information
Ahmad-S792 authored and Ahmad Saleem committed Dec 4, 2023
1 parent 7fc2fe5 commit d4b790b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
11 changes: 2 additions & 9 deletions LayoutTests/http/tests/websocket/tests/hybi/client-close_wsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,5 @@ def web_socket_transfer_data(request):
data = struct.pack('!H', 1000) + ('close_frame[:2]={}'.format(close_frame[:2]).replace("='", "=b'")).encode()
request.connection.write(stream.create_close_frame(data))

# If the following assertion fails, AssertionError will be raised,
# which will prevent pywebsocket from sending a close frame.
# In this case, the client will fail to finish closing handshake, thus
# closeEvent.wasClean will become false.
assert close_frame[:2] == b'\x88\x80'

# Pretend we have received a close frame from the client.
# After this function exits, pywebsocket will send a close frame automatically.
request.client_terminated = True
# Tell pywebsocket we have sent a close frame to the client, so it can close the connection.
request.server_terminated = True
2 changes: 0 additions & 2 deletions LayoutTests/platform/ios-wk2/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -1912,8 +1912,6 @@ webkit.org/b/215476 [ Release ] imported/w3c/web-platform-tests/css/css-grid/abs

webkit.org/b/215476 [ Release ] imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-long-crash.html [ Pass Timeout ]

webkit.org/b/215773 http/tests/websocket/tests/hybi/client-close-2.html [ Pass Failure ]

webkit.org/b/227283 imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-inline-contribution-001.html [ ImageOnlyFailure ]
webkit.org/b/227283 imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-inline-contribution-002.html [ ImageOnlyFailure ]

Expand Down
3 changes: 0 additions & 3 deletions LayoutTests/platform/mac-wk1/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -2199,9 +2199,6 @@ webkit.org/b/223944 [ BigSur Debug ] imported/w3c/web-platform-tests/xhr/event-u

webkit.org/b/223816 [ arm64 ] platform/mac/fast/objc/webScriptObject-hasWebScriptKey.html [ Failure ]

# rdar://80343074 ([ Mac wk1 ] http/tests/websocket/tests/hybi/client-close-2.html [ Failure ])
http/tests/websocket/tests/hybi/client-close-2.html [ Pass Failure ]

# webkit.org/b/221300 Updating tests expectations for 3 tests
[ Monterey+ ] imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-v-bitrate.html [ Skip ]
[ Monterey+ ] imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-v-framerate.html [ Skip ]
Expand Down

0 comments on commit d4b790b

Please sign in to comment.