Tests are in web-platform-tests: html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/ Online version (times out at times, not sure what's up): https://w3c-test.org/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/ Change to the standard which will land later today: https://github.com/whatwg/html/pull/2518 Once it lands, it's part of https://html.spec.whatwg.org/multipage/infrastructure.html#safe-passing-of-structured-data
Verified many of these tests pass in current Safari. SharedArrayBuffer is not yet status=experimental so I didn't test Chrome's in-progress implementation - issue 709179
But the fact that SharedArrayBuffer works at all in Safari and not Chrome is easy to confirm as a Hotlist-Interop issue ;-)
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/43a78b926f0d6bdbaadbd804351cac6021415c97 commit 43a78b926f0d6bdbaadbd804351cac6021415c97 Author: binji <binji@chromium.org> Date: Tue May 09 03:40:44 2017 Run SharedArrayBuffer WPT tests in virtual/sharedarraybuffer testsuite This also fixes an issue in postMessage when CanTransferArrayBuffersAndImageBitmaps is false (e.g. MessagePorts). Previously, we would remove all transferables from the transferables list, serialize that, then transfer the transferables separately. This prevents an exception from being thrown when a SharedArrayBuffer is in the transferables list. BUG=chromium:716320 Review-Url: https://codereview.chromium.org/2860303002 Cr-Commit-Position: refs/heads/master@{#470154} [modify] https://crrev.com/43a78b926f0d6bdbaadbd804351cac6021415c97/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/43a78b926f0d6bdbaadbd804351cac6021415c97/third_party/WebKit/LayoutTests/VirtualTestSuites [modify] https://crrev.com/43a78b926f0d6bdbaadbd804351cac6021415c97/third_party/WebKit/LayoutTests/fast/workers/worker-sharedarraybuffer-transfer.html [add] https://crrev.com/43a78b926f0d6bdbaadbd804351cac6021415c97/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/README.txt [add] https://crrev.com/43a78b926f0d6bdbaadbd804351cac6021415c97/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/identity-not-preserved-expected.txt [add] https://crrev.com/43a78b926f0d6bdbaadbd804351cac6021415c97/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-transferring-expected.txt [add] https://crrev.com/43a78b926f0d6bdbaadbd804351cac6021415c97/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-history-expected.txt [add] https://crrev.com/43a78b926f0d6bdbaadbd804351cac6021415c97/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-domain-success.sub-expected.txt [add] https://crrev.com/43a78b926f0d6bdbaadbd804351cac6021415c97/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-serviceworker-failure.https-expected.txt [add] https://crrev.com/43a78b926f0d6bdbaadbd804351cac6021415c97/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-similar-but-cross-origin-success.sub-expected.txt [add] https://crrev.com/43a78b926f0d6bdbaadbd804351cac6021415c97/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-simple-success-expected.txt [modify] https://crrev.com/43a78b926f0d6bdbaadbd804351cac6021415c97/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/workers/worker-sharedarraybuffer-transfer-expected.txt [modify] https://crrev.com/43a78b926f0d6bdbaadbd804351cac6021415c97/third_party/WebKit/Source/bindings/core/v8/serialization/SerializedScriptValue.cpp [modify] https://crrev.com/43a78b926f0d6bdbaadbd804351cac6021415c97/third_party/WebKit/Source/bindings/core/v8/serialization/SerializedScriptValue.h [modify] https://crrev.com/43a78b926f0d6bdbaadbd804351cac6021415c97/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl [modify] https://crrev.com/43a78b926f0d6bdbaadbd804351cac6021415c97/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/982c3164033d3afd51c0d765fc4af98f22b5ccd4 commit 982c3164033d3afd51c0d765fc4af98f22b5ccd4 Author: Malcolm White <malcolmwhite@google.com> Date: Thu Jan 18 19:55:48 2018 De/serializes SharedArrayBuffers. This is the v8 side of changes; blink changes are at https://chromium-review.googlesource.com/c/chromium/src/+/809228 BUG=chromium:716320 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng Change-Id: Ia77764aed09dd609bf2304fe3c392a0e8ee16334 Reviewed-on: https://chromium-review.googlesource.com/847337 Reviewed-by: v8 autoroll <v8-autoroll@chromium.org> Cr-Original-Commit-Position: refs/heads/6.5.123@{#1} Cr-Original-Branched-From: 2a8e1e4a9470bc3a92c58fde069901497a3f3fed-refs/heads/master@{#50331} Reviewed-on: https://chromium-review.googlesource.com/854395 Commit-Queue: Malcolm White <malcolmwhite@google.com> Reviewed-by: Ben Smith <binji@chromium.org> Cr-Commit-Position: refs/heads/master@{#50699} [modify] https://crrev.com/982c3164033d3afd51c0d765fc4af98f22b5ccd4/include/v8.h [modify] https://crrev.com/982c3164033d3afd51c0d765fc4af98f22b5ccd4/src/api.cc [modify] https://crrev.com/982c3164033d3afd51c0d765fc4af98f22b5ccd4/src/d8.cc [modify] https://crrev.com/982c3164033d3afd51c0d765fc4af98f22b5ccd4/src/value-serializer.cc [modify] https://crrev.com/982c3164033d3afd51c0d765fc4af98f22b5ccd4/src/value-serializer.h [modify] https://crrev.com/982c3164033d3afd51c0d765fc4af98f22b5ccd4/test/mjsunit/d8/d8-worker-sharedarraybuffer.js [modify] https://crrev.com/982c3164033d3afd51c0d765fc4af98f22b5ccd4/test/unittests/value-serializer-unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7bbf3496898be9fb8a345f1df70d4a1e92edb3d7 commit 7bbf3496898be9fb8a345f1df70d4a1e92edb3d7 Author: Malcolm White <malcolmwhite@google.com> Date: Wed Jan 24 16:46:20 2018 Pass SharedArrayBuffers over MessagePorts This is the blink side of changes, meant to follow the v8 changes at https://chromium-review.googlesource.com/c/v8/v8/+/854395 This leverages the lazy serialization put in place in https://chromium-review.googlesource.com/840606. Before the above change, a SerializedScriptValue containing SharedArrayBuffers would be eagerly serialized by mojo. When serialized, the SSV would drop its SharedArrayBuffers. After the above change, MessagePort serializes SSV's lazily. This means that mojo keeps the original SSV instance alive unless the message crosses a process boundary. With this, SharedArrayBuffers are retained by their SSV for in-process MessagePort postMessage's. Because lazy serialization takes care of passing SharedArrayBuffers over the wire, this change only needs to set up the communication between the SSV and v8 for serialization. BUG=chromium:716320 Change-Id: If8337f5a0a46aa757a6065cf0a32921df8baad70 Reviewed-on: https://chromium-review.googlesource.com/809228 Commit-Queue: Malcolm White <malcolmwhite@google.com> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Ben Smith <binji@chromium.org> Cr-Commit-Position: refs/heads/master@{#531560} [modify] https://crrev.com/7bbf3496898be9fb8a345f1df70d4a1e92edb3d7/third_party/WebKit/LayoutTests/FlagExpectations/site-per-process [modify] https://crrev.com/7bbf3496898be9fb8a345f1df70d4a1e92edb3d7/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/7bbf3496898be9fb8a345f1df70d4a1e92edb3d7/third_party/WebKit/LayoutTests/VirtualTestSuites [add] https://crrev.com/7bbf3496898be9fb8a345f1df70d4a1e92edb3d7/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/README.txt [modify] https://crrev.com/7bbf3496898be9fb8a345f1df70d4a1e92edb3d7/third_party/WebKit/Source/bindings/core/v8/serialization/SerializedScriptValue.cpp [modify] https://crrev.com/7bbf3496898be9fb8a345f1df70d4a1e92edb3d7/third_party/WebKit/Source/bindings/core/v8/serialization/SerializedScriptValue.h [modify] https://crrev.com/7bbf3496898be9fb8a345f1df70d4a1e92edb3d7/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueDeserializer.cpp [modify] https://crrev.com/7bbf3496898be9fb8a345f1df70d4a1e92edb3d7/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueDeserializer.h [modify] https://crrev.com/7bbf3496898be9fb8a345f1df70d4a1e92edb3d7/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializer.cpp [modify] https://crrev.com/7bbf3496898be9fb8a345f1df70d4a1e92edb3d7/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializer.h
Issue 718263 has been merged into this issue.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/0bae89a1dd0d769e1eecf01db8be0ec1192c2459 commit 0bae89a1dd0d769e1eecf01db8be0ec1192c2459 Author: Peter Mayo <petermayo@chromium.org> Date: Tue Jul 17 15:28:29 2018 Re-enable shared-array-buffer serialization-via-idb.any.worker This test is passing in the virtual/sharedarraybuffer/ suite. https://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=webkit_layout_tests&tests=virtual/sharedarraybuffer/external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-idb.any.worker.html Local experimentation indicates this change fixed the timeout: https://chromium-review.googlesource.com/1108744 Bug: 716320 Change-Id: I4091c71917bc79453442d6bd46fd2194be831a60 Reviewed-on: https://chromium-review.googlesource.com/1139379 Reviewed-by: Peter Mayo <petermayo@chromium.org> Reviewed-by: Robert Ma <robertma@chromium.org> Commit-Queue: Robert Ma <robertma@chromium.org> Cr-Commit-Position: refs/heads/master@{#575646} [modify] https://crrev.com/0bae89a1dd0d769e1eecf01db8be0ec1192c2459/third_party/WebKit/LayoutTests/TestExpectations
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f9e9e682ebb55a57f33f266817758f370418203a commit f9e9e682ebb55a57f33f266817758f370418203a Author: Timothy Gu <timothygu@chromium.org> Date: Wed Sep 12 01:06:08 2018 Reenable some LayoutTests R=foolip@chromium.org Bug: 626703, 716320 Change-Id: I41c76ac598f77d8f1c3633a22cde413f9aed6418 Reviewed-on: https://chromium-review.googlesource.com/1220108 Reviewed-by: Robert Ma <robertma@chromium.org> Commit-Queue: Timothy Gu <timothygu@chromium.org> Cr-Commit-Position: refs/heads/master@{#590557} [modify] https://crrev.com/f9e9e682ebb55a57f33f266817758f370418203a/third_party/WebKit/LayoutTests/TestExpectations
Comment 1 by rbyers@chromium.org
, May 3 2017Components: Blink>JavaScript
Labels: -OS-Mac OS-All