Commit f99dd3c1 authored by Jonathan Ross's avatar Jonathan Ross Committed by Commit Bot

Revert "[WebSocket] Test header + close frame in same packet"

This reverts commit 3be4a6e9.

Reason for revert: Updated test is flaking on all platforms. crbug.com/1091377

Original change's description:
> [WebSocket] Test header + close frame in same packet
> 
> Modify the existing web platform test opening-handshake/005.html to send
> the response header and the close frame in the same packet. This
> verifies that Chrome passes the close data to JavaScript correctly in
> this case.
> 
> This increases the coverage of the existing test, so there's no need to
> retain the old behaviour.
> 
> Also remove the timeout expectations for this test, and make sure it
> doesn't timeout on failure.
> 
> Closed: 1090210
> Change-Id: I327c55d1517615511d6d71e1b464d5d3dc03b502
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2228252
> Commit-Queue: Adam Rice <ricea@chromium.org>
> Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#775124}

TBR=ricea@chromium.org,yhirano@chromium.org

Change-Id: I729663e5d0f7f6e41304b67c135b9af8946e503e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2231268Reviewed-by: default avatarJonathan Ross <jonross@chromium.org>
Commit-Queue: Jonathan Ross <jonross@chromium.org>
Cr-Commit-Position: refs/heads/master@{#775233}
parent 9bc77d0a
......@@ -2238,6 +2238,10 @@ crbug.com/626703 crbug.com/946710 http/tests/devtools/extensions/extensions-side
crbug.com/751952 virtual/text-antialias/international/complex-text-rectangle.html [ Timeout Pass ]
crbug.com/751952 [ Win ] editing/selection/modify_extend/extend_by_character.html [ Failure Pass ]
# Websockets
# Cannot be rebaselined because the output contains a timestamp and a random number.
crbug.com/803200 external/wpt/websockets/opening-handshake/005.html?wss [ Pass Failure Timeout ]
crbug.com/805463 external/wpt/acid/acid3/numbered-tests.html [ Skip ]
crbug.com/828506 [ Win ] fast/events/touch/scroll-without-mouse-lacks-mousemove-events.html [ Pass Failure ]
......@@ -2878,6 +2882,9 @@ crbug.com/626703 [ Win ] external/wpt/webrtc/RTCPeerConnection-operations.https.
crbug.com/626703 [ Linux ] external/wpt/content-dpr/content-dpr-various-elements.html [ Failure ]
crbug.com/626703 [ Mac ] external/wpt/content-dpr/content-dpr-various-elements.html [ Failure ]
crbug.com/626703 [ Win ] external/wpt/content-dpr/content-dpr-various-elements.html [ Failure ]
crbug.com/626703 [ Linux ] external/wpt/websockets/opening-handshake/005.html [ Timeout ]
crbug.com/626703 [ Mac ] external/wpt/websockets/opening-handshake/005.html [ Timeout ]
crbug.com/626703 [ Win ] external/wpt/websockets/opening-handshake/005.html [ Timeout ]
crbug.com/626703 [ Mac10.14 ] external/wpt/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-top-left.html [ Timeout ]
crbug.com/626703 [ Linux ] external/wpt/workers/abrupt-completion.html [ Timeout ]
crbug.com/626703 [ Mac ] external/wpt/workers/abrupt-completion.html [ Timeout ]
......
......@@ -5,8 +5,8 @@ from mod_pywebsocket.handshake import AbortedByUserException, hybi
def web_socket_do_extra_handshake(request):
# Send simple response header. This test implements the handshake manually,
# so that we can send the header in the same packet as the close frame.
# Send simple response header. This test implements the handshake
# manually. It's not clear why.
msg = (b'HTTP/1.1 101 Switching Protocols:\x0D\x0A'
b'Connection: Upgrade\x0D\x0A'
b'Upgrade: WebSocket\x0D\x0A'
......@@ -14,11 +14,10 @@ def web_socket_do_extra_handshake(request):
b'Sec-WebSocket-Origin: %s\x0D\x0A'
b'Sec-WebSocket-Accept: %s\x0D\x0A\x0D\x0A') % (request.ws_origin.encode(
'UTF-8'), hybi.compute_accept_from_unicode(request.headers_in.get(common.SEC_WEBSOCKET_KEY_HEADER)))
# Create a clean close frame.
close_body = stream.create_closing_handshake_body(1001, 'PASS')
close_frame = stream.create_close_frame(close_body)
# Concatenate the header and the close frame and write them to the socket.
request.connection.write(msg + close_frame)
request.connection.write(msg)
# Send a clean close frame.
body = stream.create_closing_handshake_body(1000, '')
request.connection.write(stream.create_close_frame(body))
# Wait for the responding close frame from the user agent. It's not possible
# to use the stream methods at this point because the stream hasn't been
# established from pywebsocket's point of view. Instead just read the
......
<!doctype html>
<title>WebSockets: response header and close frame in same packet</title>
<title>WebSockets: proper first line</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=../constants.js?pipe=sub></script>
......@@ -13,13 +13,10 @@ async_test(function(t) {
ws.onopen = t.step_func(function(e) {
ws.onclose = t.step_func(function(e) {
assert_equals(e.wasClean, true);
assert_equals(e.code, 1001);
assert_equals(e.reason, 'PASS');
ws.onclose = t.unreached_func('onclose should not be called twice');
ws.onclose = t.unreached_func();
t.step_timeout(() => t.done(), 50);
})
ws.close();
})
ws.onclose = t.unreached_func('onclose should not be called before onopen');
});
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment