Diff
Added: trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-65K-data.any-expected.txt (0 => 294413)
--- trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-65K-data.any-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-65K-data.any-expected.txt 2022-05-18 18:40:08 UTC (rev 294413)
@@ -0,0 +1,3 @@
+
+FAIL Send 65K data on a WebSocket - Connection should be closed assert_equals: expected 0 but got 65000
+
Added: trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-binary-65K-arraybuffer.any-expected.txt (0 => 294413)
--- trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-binary-65K-arraybuffer.any-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-binary-65K-arraybuffer.any-expected.txt 2022-05-18 18:40:08 UTC (rev 294413)
@@ -0,0 +1,3 @@
+
+FAIL Send 65K binary data on a WebSocket - ArrayBuffer - Connection should be closed assert_equals: expected 0 but got 65000
+
Added: trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-binary-65K-arraybuffer.any.worker-expected.txt (0 => 294413)
--- trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-binary-65K-arraybuffer.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-binary-65K-arraybuffer.any.worker-expected.txt 2022-05-18 18:40:08 UTC (rev 294413)
@@ -0,0 +1,3 @@
+
+FAIL Send 65K binary data on a WebSocket - ArrayBuffer - Connection should be closed assert_equals: expected 0 but got 65000
+
Added: trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-binary-arraybuffer.any-expected.txt (0 => 294413)
--- trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-binary-arraybuffer.any-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-binary-arraybuffer.any-expected.txt 2022-05-18 18:40:08 UTC (rev 294413)
@@ -0,0 +1,3 @@
+
+FAIL Send binary data on a WebSocket - ArrayBuffer - Connection should be closed assert_equals: expected 0 but got 15
+
Added: trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-binary-arraybuffer.any.worker-expected.txt (0 => 294413)
--- trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-binary-arraybuffer.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-binary-arraybuffer.any.worker-expected.txt 2022-05-18 18:40:08 UTC (rev 294413)
@@ -0,0 +1,3 @@
+
+FAIL Send binary data on a WebSocket - ArrayBuffer - Connection should be closed assert_equals: expected 0 but got 15
+
Added: trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-data.any-expected.txt (0 => 294413)
--- trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-data.any-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-data.any-expected.txt 2022-05-18 18:40:08 UTC (rev 294413)
@@ -0,0 +1,3 @@
+
+FAIL Send data on a WebSocket - Connection should be closed assert_equals: expected 0 but got 15
+
Added: trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-data.any.worker-expected.txt (0 => 294413)
--- trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-data.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-data.any.worker-expected.txt 2022-05-18 18:40:08 UTC (rev 294413)
@@ -0,0 +1,3 @@
+
+FAIL Send data on a WebSocket - Connection should be closed assert_equals: expected 0 but got 15
+
Added: trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-paired-surrogates.any-expected.txt (0 => 294413)
--- trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-paired-surrogates.any-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-paired-surrogates.any-expected.txt 2022-05-18 18:40:08 UTC (rev 294413)
@@ -0,0 +1,3 @@
+
+FAIL Send paired surrogates data on a WebSocket - Connection should be closed assert_equals: expected 0 but got 4
+
Added: trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-paired-surrogates.any.worker-expected.txt (0 => 294413)
--- trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-paired-surrogates.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-paired-surrogates.any.worker-expected.txt 2022-05-18 18:40:08 UTC (rev 294413)
@@ -0,0 +1,3 @@
+
+FAIL Send paired surrogates data on a WebSocket - Connection should be closed assert_equals: expected 0 but got 4
+
Added: trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-unicode-data.any.worker-expected.txt (0 => 294413)
--- trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-unicode-data.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/Send-unicode-data.any.worker-expected.txt 2022-05-18 18:40:08 UTC (rev 294413)
@@ -0,0 +1,3 @@
+
+FAIL Send unicode data on a WebSocket - Connection should be closed assert_equals: expected 0 but got 12
+
Added: trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/bufferedAmount-unchanged-by-sync-xhr.any.worker-expected.txt (0 => 294413)
--- trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/bufferedAmount-unchanged-by-sync-xhr.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/bufferedAmount-unchanged-by-sync-xhr.any.worker-expected.txt 2022-05-18 18:40:08 UTC (rev 294413)
@@ -0,0 +1,3 @@
+
+FAIL bufferedAmount should not be updated during a sync XHR assert_equals: expected 5 but got 0
+
Added: trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-arraybuffer-expected.txt (0 => 294413)
--- trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-arraybuffer-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-arraybuffer-expected.txt 2022-05-18 18:40:08 UTC (rev 294413)
@@ -0,0 +1,3 @@
+
+FAIL WebSockets: bufferedAmount for ArrayBuffer assert_equals: expected 10 but got 0
+
Added: trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-blob-expected.txt (0 => 294413)
--- trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-blob-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-blob-expected.txt 2022-05-18 18:40:08 UTC (rev 294413)
@@ -0,0 +1,3 @@
+
+FAIL WebSockets: bufferedAmount for blob assert_equals: expected 10 but got 0
+
Modified: trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-getting-expected.txt (294412 => 294413)
--- trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-getting-expected.txt 2022-05-18 18:37:30 UTC (rev 294412)
+++ trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-getting-expected.txt 2022-05-18 18:40:08 UTC (rev 294413)
@@ -1,3 +1,3 @@
-FAIL WebSockets: bufferedAmount after send()ing assert_true: bufferedAmount after received "x" expected true got false
+FAIL WebSockets: bufferedAmount after send()ing assert_equals: bufferedAmount after sent "x" expected 1 but got 0
Added: trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-large-expected.txt (0 => 294413)
--- trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-large-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-large-expected.txt 2022-05-18 18:40:08 UTC (rev 294413)
@@ -0,0 +1,3 @@
+
+FAIL WebSockets: bufferedAmount for 65K data assert_equals: expected 0 but got 65000
+
Added: trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-unicode-expected.txt (0 => 294413)
--- trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-unicode-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-unicode-expected.txt 2022-05-18 18:40:08 UTC (rev 294413)
@@ -0,0 +1,3 @@
+
+FAIL WebSockets: bufferedAmount for unicode data assert_equals: expected 0 but got 12
+
Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.cpp (294412 => 294413)
--- trunk/Source/WebCore/Modules/websockets/WebSocket.cpp 2022-05-18 18:37:30 UTC (rev 294412)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.cpp 2022-05-18 18:40:08 UTC (rev 294413)
@@ -353,7 +353,15 @@
return { };
}
// FIXME: WebSocketChannel also has a m_bufferedAmount. Remove that one. This one is the correct one accessed by JS.
- m_bufferedAmount = saturateAdd(m_bufferedAmount, utf8.length());
+#if HAVE(NSURLSESSION_WEBSOCKET)
+ bool shouldSynchronouslyUpdateBufferedAmount = RuntimeEnabledFeatures::sharedFeatures().isNSURLSessionWebSocketEnabled();
+#elif PLATFORM(MAC)
+ bool shouldSynchronouslyUpdateBufferedAmount = false;
+#else
+ bool shouldSynchronouslyUpdateBufferedAmount = true;
+#endif
+ if (shouldSynchronouslyUpdateBufferedAmount)
+ m_bufferedAmount = saturateAdd(m_bufferedAmount, utf8.length());
ASSERT(m_channel);
m_channel->send(WTFMove(utf8));
return { };
@@ -370,7 +378,15 @@
m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, getFramingOverhead(payloadSize));
return { };
}
- m_bufferedAmount = saturateAdd(m_bufferedAmount, binaryData.byteLength());
+#if HAVE(NSURLSESSION_WEBSOCKET)
+ bool shouldSynchronouslyUpdateBufferedAmount = RuntimeEnabledFeatures::sharedFeatures().isNSURLSessionWebSocketEnabled();
+#elif PLATFORM(MAC)
+ bool shouldSynchronouslyUpdateBufferedAmount = false;
+#else
+ bool shouldSynchronouslyUpdateBufferedAmount = true;
+#endif
+ if (shouldSynchronouslyUpdateBufferedAmount)
+ m_bufferedAmount = saturateAdd(m_bufferedAmount, binaryData.byteLength());
ASSERT(m_channel);
m_channel->send(binaryData, 0, binaryData.byteLength());
return { };
@@ -388,7 +404,15 @@
m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, getFramingOverhead(payloadSize));
return { };
}
- m_bufferedAmount = saturateAdd(m_bufferedAmount, arrayBufferView.byteLength());
+#if HAVE(NSURLSESSION_WEBSOCKET)
+ bool shouldSynchronouslyUpdateBufferedAmount = RuntimeEnabledFeatures::sharedFeatures().isNSURLSessionWebSocketEnabled();
+#elif PLATFORM(MAC)
+ bool shouldSynchronouslyUpdateBufferedAmount = false;
+#else
+ bool shouldSynchronouslyUpdateBufferedAmount = true;
+#endif
+ if (shouldSynchronouslyUpdateBufferedAmount)
+ m_bufferedAmount = saturateAdd(m_bufferedAmount, arrayBufferView.byteLength());
ASSERT(m_channel);
m_channel->send(*arrayBufferView.unsharedBuffer(), arrayBufferView.byteOffset(), arrayBufferView.byteLength());
return { };
@@ -405,7 +429,15 @@
m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, getFramingOverhead(payloadSize));
return { };
}
- m_bufferedAmount = saturateAdd(m_bufferedAmount, binaryData.size());
+#if HAVE(NSURLSESSION_WEBSOCKET)
+ bool shouldSynchronouslyUpdateBufferedAmount = RuntimeEnabledFeatures::sharedFeatures().isNSURLSessionWebSocketEnabled();
+#elif PLATFORM(MAC)
+ bool shouldSynchronouslyUpdateBufferedAmount = false;
+#else
+ bool shouldSynchronouslyUpdateBufferedAmount = true;
+#endif
+ if (shouldSynchronouslyUpdateBufferedAmount)
+ m_bufferedAmount = saturateAdd(m_bufferedAmount, binaryData.size());
ASSERT(m_channel);
m_channel->send(binaryData);
return { };