haikuwebkit/LayoutTests/workers/sab/postMessage-transfer-type-e...

11 lines
321 B
Plaintext
Raw Permalink Normal View History

Checks that worker.postMessage rejects SharedArrayBuffers in the transfer list
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
WebAssembly API: test with neutered inputs https://bugs.webkit.org/show_bug.cgi?id=163899 Reviewed by JF Bastien. JSTests: * wasm/js-api/neutered-inputs.js: Added. (const.testFunction): (const.testConstructor): * wasm/js-api/test_basic_api.js: (const.c.in.constructorProperties.switch): Source/JavaScriptCore: Add tests to check that we properly throw a type error when we get a transferred ArrayBuffer. Also, we should make sure we cannot post message a wasm memory's ArrayBuffer. * API/JSTypedArray.cpp: (JSObjectGetArrayBufferBytesPtr): * runtime/ArrayBuffer.cpp: (JSC::ArrayBuffer::makeShared): (JSC::ArrayBuffer::makeWasmMemory): (JSC::ArrayBuffer::transferTo): (JSC::ArrayBuffer::neuter): (JSC::ArrayBuffer::notifyIncommingReferencesOfTransfer): (JSC::errorMesasgeForTransfer): * runtime/ArrayBuffer.h: (JSC::ArrayBuffer::isLocked): (JSC::ArrayBuffer::isWasmMemory): * wasm/js/JSWebAssemblyMemory.cpp: (JSC::JSWebAssemblyMemory::buffer): (JSC::JSWebAssemblyMemory::grow): Source/WebCore: Make it not possible to transfer an ArrayBuffer that is backed by a wasm memory. Test: workers/wasm-mem-post-message.html * bindings/js/SerializedScriptValue.cpp: (WebCore::SerializedScriptValue::create): LayoutTests: This patch dups Saam's de-modularized builder. * workers/sab/postMessage-transfer-type-error-expected.txt: * workers/wasm-mem-post-message-expected.txt: Added. * workers/wasm-mem-post-message.html: Added. * workers/wasm-mem-post-message/test.js: Added. (worker.onmessage): * workers/wasm-mem-post-message/worker.js: Added. (onmessage): * workers/wasm-resources/builder.js: Added. (const._fail): (const.isNotA.assert.isNotA): (const): (switch.typeof): (Builder): (Builder.prototype.setChecked): (Builder.prototype.setPreamble): (Builder.prototype._functionIndexSpaceKeyHash): (Builder.prototype._registerFunctionToIndexSpace): (Builder.prototype._getFunctionFromIndexSpace): (Builder.prototype._registerSectionBuilders.const.section.in.WASM.description.section.switch.section.case.string_appeared_here.this.section): (Builder.prototype._registerSectionBuilders.const.section.in.WASM.description.section.switch.section.const.codeBuilder.End.switch.case.string_appeared_here.e): (Builder.prototype._registerSectionBuilders.this.Unknown): Canonical link: https://commits.webkit.org/189196@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217052 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-18 18:22:19 +00:00
PASS postMessageTransferSharedArrayBuffer() threw exception TypeError: Cannot transfer a SharedArrayBuffer.
PASS successfullyParsed is true
TEST COMPLETE