LayoutTests/ChangeLog

 12021-07-14 Alex Christensen <achristensen@webkit.org>
 2
 3 Add test showing multiple Set-Cookie HTTP header fields in websocket handshake get processed
 4 https://bugs.webkit.org/show_bug.cgi?id=227739
 5
 6 Reviewed by Geoff Garen.
 7
 8 When using NSURLSession's WebSocket implementation, the multiple cookies are separated with semicolons,
 9 which matches the behavior of Chrome and Firefox. Shipping OSes separate the cookies with commas.
 10
 11 Add a test to verify this behavior.
 12
 13 * http/tests/websocket/tests/hybi/multiple-set-cookies-expected.txt: Added.
 14 * http/tests/websocket/tests/hybi/multiple-set-cookies.html: Added.
 15 * http/tests/websocket/tests/hybi/multiple_set_cookie_wsh.py: Added.
 16 (web_socket_do_extra_handshake):
 17 (web_socket_transfer_data):
 18 * platform/ios/http/tests/websocket/tests/hybi/multiple-set-cookies-expected.txt: Added.
 19 * platform/mac-bigsur/http/tests/websocket/tests/hybi/multiple-set-cookies-expected.txt: Added.
 20 * platform/mac-catalina/http/tests/websocket/tests/hybi/multiple-set-cookies-expected.txt: Added.
 21 * platform/mac-mojave/http/tests/websocket/tests/hybi/multiple-set-cookies-expected.txt: Added.
 22 * win/http/tests/websocket/tests/hybi/multiple-set-cookies-expected.txt: Added.
 23
1242021-07-14 Arcady Goldmints-Orlov <agoldmints@igalia.com>
225
326 [GStreamer] mark media/media-source/media-webm-vorbis-partial.html and media/media-source/media-webm-opus-partial.html as failing
279909

LayoutTests/http/tests/websocket/tests/hybi/multiple-set-cookies-expected.txt

 1ALERT: a=b; c=d
 2
nonexistent

LayoutTests/http/tests/websocket/tests/hybi/multiple-set-cookies.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4<script>
 5if (window.testRunner) {
 6 testRunner.waitUntilDone();
 7 testRunner.dumpAsText();
 8}
 9
 10function runTest()
 11{
 12 var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hybi/multiple_set_cookie");
 13 ws.onopen = function() {
 14 alert(document.cookie);
 15 if (window.testRunner) {
 16 testRunner.notifyDone();
 17 }
 18 }
 19 ws.onerror = function(error) {
 20 alert('error: ' + error);
 21 }
 22}
 23</script>
 24</head>
 25<body onload='runTest()'>
 26</body>
 27</html>
nonexistent

LayoutTests/http/tests/websocket/tests/hybi/multiple_set_cookie_wsh.py

 1#
 2# Copyright (C) 2021 Apple Inc. All rights reserved.
 3#
 4# Redistribution and use in source and binary forms, with or without
 5# modification, are permitted provided that the following conditions
 6# are met:
 7# 1. Redistributions of source code must retain the above copyright
 8# notice, this list of conditions and the following disclaimer.
 9# 2. Redistributions in binary form must reproduce the above copyright
 10# notice, this list of conditions and the following disclaimer in the
 11# documentation and/or other materials provided with the distribution.
 12#
 13# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23# THE POSSIBILITY OF SUCH DAMAGE.
 24#
 25
 26
 27def web_socket_do_extra_handshake(request):
 28 request.extra_headers.append(('Set-Cookie', 'a=b'))
 29 request.extra_headers.append(('Set-Cookie', 'c=d'))
 30
 31
 32def web_socket_transfer_data(request):
 33 pass
nonexistent

LayoutTests/platform/ios/http/tests/websocket/tests/hybi/multiple-set-cookies-expected.txt

 1ALERT: a=b,c=d
 2
nonexistent

LayoutTests/platform/mac-bigsur/http/tests/websocket/tests/hybi/multiple-set-cookies-expected.txt

 1ALERT: a=b,c=d
 2
nonexistent

LayoutTests/platform/mac-catalina/http/tests/websocket/tests/hybi/multiple-set-cookies-expected.txt

 1ALERT: a=b,c=d
 2
nonexistent

LayoutTests/platform/mac-mojave/http/tests/websocket/tests/hybi/multiple-set-cookies-expected.txt

 1ALERT: a=b,c=d
 2
nonexistent

LayoutTests/platform/win/http/tests/websocket/tests/hybi/multiple-set-cookies-expected.txt

 1ALERT: a=b
 2
nonexistent