From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../webmessaging/Channel_postMessage_Blob.any.js | 33 ++ .../Channel_postMessage_DataCloneErr.any.js | 14 + .../Channel_postMessage_clone_port.any.js | 31 ++ .../Channel_postMessage_clone_port_error.any.js | 14 + .../Channel_postMessage_event_properties.any.js | 24 ++ ...Channel_postMessage_ports_readonly_array.any.js | 28 ++ .../Channel_postMessage_target_source.any.js | 23 ++ ...sage_transfer_xsite_incoming_messages.window.js | 32 ++ ...nnel_postMessage_with_transfer_entangled.any.js | 36 ++ ...tMessage_with_transfer_incoming_messages.any.js | 32 ++ ...tMessage_with_transfer_outgoing_messages.any.js | 35 ++ testing/web-platform/tests/webmessaging/META.yml | 6 + .../tests/webmessaging/MessageEvent-trusted.any.js | 32 ++ .../webmessaging/MessageEvent-trusted.window.js | 9 + .../tests/webmessaging/MessageEvent.any.js | 22 ++ ...eEvent_onmessage_postMessage_infinite_loop.html | 31 ++ .../tests/webmessaging/MessageEvent_properties.htm | 32 ++ .../MessagePort_initial_disabled.any.js | 10 + .../MessagePort_onmessage_start.any.js | 10 + testing/web-platform/tests/webmessaging/README.md | 2 + .../Transferred_objects_unusable.sub.htm | 60 ++++ .../webmessaging/broadcastchannel/basics.any.js | 128 +++++++ .../tests/webmessaging/broadcastchannel/blobs.html | 82 +++++ .../broadcastchannel/cross-origin.html | 38 +++ .../cross-partition.https.tentative.html | 356 +++++++++++++++++++ .../broadcastchannel/detached-iframe.html | 174 ++++++++++ .../webmessaging/broadcastchannel/interface.any.js | 65 ++++ .../broadcastchannel/opaque-origin.html | 193 +++++++++++ .../webmessaging/broadcastchannel/ordering.html | 116 +++++++ .../webmessaging/broadcastchannel/origin.window.js | 10 + .../broadcastchannel/resources/cross-origin.html | 15 + .../broadcastchannel/resources/ordering.html | 78 +++++ .../broadcastchannel/resources/origin.html | 8 + .../broadcastchannel/resources/sandboxed.html | 10 + .../broadcastchannel/resources/service-worker.js | 15 + .../broadcastchannel/resources/worker.js | 37 ++ .../webmessaging/broadcastchannel/sandbox.html | 16 + .../broadcastchannel/service-worker.https.html | 47 +++ .../webmessaging/broadcastchannel/workers.html | 375 +++++++++++++++++++++ .../tests/webmessaging/event.data.sub.htm | 44 +++ .../tests/webmessaging/event.origin.sub.htm | 66 ++++ .../tests/webmessaging/event.ports.sub.htm | 49 +++ .../tests/webmessaging/event.source.htm | 51 +++ .../webmessaging/event.source.xorigin.sub.htm | 51 +++ .../webmessaging/message-channels/basics.any.js | 12 + .../webmessaging/message-channels/close.any.js | 62 ++++ .../message-channels/cross-document.html | 22 ++ .../message-channels/detached-iframe.window.js | 46 +++ .../dictionary-transferrable.any.js | 13 + .../message-channels/implied-start.any.js | 14 + .../webmessaging/message-channels/no-start.any.js | 9 + .../resources/cross-document-1.html | 8 + .../resources/cross-document-2.html | 10 + .../user-activation.tentative.any.js | 21 ++ .../worker-post-after-close.any.js | 28 ++ .../webmessaging/message-channels/worker.any.js | 17 + .../tests/webmessaging/messageerror.html | 44 +++ .../broadcastchannel-current.sub.html | 45 +++ .../broadcastchannel-incumbent.sub.html | 34 ++ .../multi-globals/messageport-current.html | 39 +++ .../multi-globals/messageport-incumbent.html | 35 ++ .../support/current-document-domain.sub.html | 10 + .../multi-globals/support/current.html | 5 + .../support/incumbent-document-domain.sub.html | 14 + .../multi-globals/support/incumbent.html | 13 + .../webmessaging/postMessage_ArrayBuffer.sub.htm | 44 +++ .../postMessage_CryptoKey_insecure.sub.html | 20 ++ .../tests/webmessaging/postMessage_Date.sub.htm | 40 +++ .../tests/webmessaging/postMessage_Document.htm | 36 ++ .../tests/webmessaging/postMessage_Function.htm | 36 ++ .../postMessage_MessagePorts_sorigin.htm | 76 +++++ .../postMessage_MessagePorts_xorigin.sub.htm | 76 +++++ .../postMessage_MessagePorts_xsite.sub.window.js | 66 ++++ .../tests/webmessaging/postMessage_arrays.sub.htm | 39 +++ .../postMessage_asterisk_xorigin.sub.htm | 52 +++ ...tMessage_cross_domain_image_transfer_2d.sub.htm | 34 ++ .../webmessaging/postMessage_crosssite.sub.htm | 29 ++ .../postMessage_dup_transfer_objects.htm | 38 +++ .../postMessage_invalid_targetOrigin.htm | 38 +++ .../tests/webmessaging/postMessage_objects.sub.htm | 40 +++ .../postMessage_origin_mismatch.sub.htm | 51 +++ .../postMessage_origin_mismatch_xorigin.sub.htm | 51 +++ .../webmessaging/postMessage_solidus_sorigin.htm | 43 +++ .../postMessage_solidus_xorigin.sub.htm | 48 +++ .../resources/post-cryptokey-to-opener.html | 6 + .../resources/transfer-arraybuffer-to-parent.html | 5 + .../support/ChildWindowPostMessage.htm | 58 ++++ .../support/MessageEvent-trusted-worker.js | 4 + .../tests/webmessaging/support/compare.js | 39 +++ .../support/cross-domain-image-receive.htm | 25 ++ .../webmessaging/with-options/broken-origin.html | 12 + .../with-options/host-specific-origin.html | 14 + .../with-options/message-channel-transferable.html | 15 + .../with-options/no-target-origin.html | 14 + .../webmessaging/with-options/null-transfer.html | 10 + .../tests/webmessaging/with-options/one-arg.html | 13 + .../webmessaging/with-options/slash-origin.html | 14 + .../with-options/undefined-transferable.html | 14 + .../with-options/unknown-parameter.html | 14 + .../tests/webmessaging/with-ports/001.html | 12 + .../tests/webmessaging/with-ports/002.html | 14 + .../tests/webmessaging/with-ports/003.html | 12 + .../tests/webmessaging/with-ports/004.html | 14 + .../tests/webmessaging/with-ports/005.html | 14 + .../tests/webmessaging/with-ports/006.html | 14 + .../tests/webmessaging/with-ports/007.html | 14 + .../tests/webmessaging/with-ports/010.html | 113 +++++++ .../tests/webmessaging/with-ports/011.html | 29 ++ .../tests/webmessaging/with-ports/012.html | 16 + .../tests/webmessaging/with-ports/013.html | 17 + .../tests/webmessaging/with-ports/014.html | 17 + .../tests/webmessaging/with-ports/015.html | 15 + .../tests/webmessaging/with-ports/016.html | 23 ++ .../tests/webmessaging/with-ports/017.html | 18 + .../tests/webmessaging/with-ports/018.html | 18 + .../tests/webmessaging/with-ports/019.html | 20 ++ .../tests/webmessaging/with-ports/020.html | 32 ++ .../tests/webmessaging/with-ports/021.html | 32 ++ .../tests/webmessaging/with-ports/023.html | 11 + .../tests/webmessaging/with-ports/024.html | 15 + .../tests/webmessaging/with-ports/025.html | 13 + .../tests/webmessaging/with-ports/026.html | 13 + .../tests/webmessaging/with-ports/027.html | 26 ++ .../tests/webmessaging/without-ports/001.html | 12 + .../tests/webmessaging/without-ports/002.html | 14 + .../tests/webmessaging/without-ports/003.html | 12 + .../tests/webmessaging/without-ports/004.html | 14 + .../tests/webmessaging/without-ports/005.html | 14 + .../tests/webmessaging/without-ports/006.html | 14 + .../tests/webmessaging/without-ports/007.html | 14 + .../tests/webmessaging/without-ports/009.html | 12 + .../tests/webmessaging/without-ports/010.html | 112 ++++++ .../tests/webmessaging/without-ports/011.html | 29 ++ .../tests/webmessaging/without-ports/012.html | 16 + .../tests/webmessaging/without-ports/013.html | 17 + .../tests/webmessaging/without-ports/014.html | 17 + .../tests/webmessaging/without-ports/015.html | 15 + .../tests/webmessaging/without-ports/016.html | 23 ++ .../tests/webmessaging/without-ports/017.html | 18 + .../tests/webmessaging/without-ports/018.html | 17 + .../tests/webmessaging/without-ports/019-1.html | 1 + .../tests/webmessaging/without-ports/019.html | 20 ++ .../tests/webmessaging/without-ports/020-1.html | 5 + .../tests/webmessaging/without-ports/020.html | 32 ++ .../tests/webmessaging/without-ports/021.html | 32 ++ .../tests/webmessaging/without-ports/023.html | 29 ++ .../tests/webmessaging/without-ports/024.html | 14 + .../tests/webmessaging/without-ports/025-1.js | 15 + .../tests/webmessaging/without-ports/025.html | 13 + .../tests/webmessaging/without-ports/026.html | 17 + .../tests/webmessaging/without-ports/027.html | 19 ++ .../tests/webmessaging/without-ports/028.html | 19 ++ .../tests/webmessaging/without-ports/029.html | 20 ++ .../worker_postMessage_user_activation.js | 3 + ...rker_postMessage_user_activation.tentative.html | 19 ++ 155 files changed, 5305 insertions(+) create mode 100644 testing/web-platform/tests/webmessaging/Channel_postMessage_Blob.any.js create mode 100644 testing/web-platform/tests/webmessaging/Channel_postMessage_DataCloneErr.any.js create mode 100644 testing/web-platform/tests/webmessaging/Channel_postMessage_clone_port.any.js create mode 100644 testing/web-platform/tests/webmessaging/Channel_postMessage_clone_port_error.any.js create mode 100644 testing/web-platform/tests/webmessaging/Channel_postMessage_event_properties.any.js create mode 100644 testing/web-platform/tests/webmessaging/Channel_postMessage_ports_readonly_array.any.js create mode 100644 testing/web-platform/tests/webmessaging/Channel_postMessage_target_source.any.js create mode 100644 testing/web-platform/tests/webmessaging/Channel_postMessage_transfer_xsite_incoming_messages.window.js create mode 100644 testing/web-platform/tests/webmessaging/Channel_postMessage_with_transfer_entangled.any.js create mode 100644 testing/web-platform/tests/webmessaging/Channel_postMessage_with_transfer_incoming_messages.any.js create mode 100644 testing/web-platform/tests/webmessaging/Channel_postMessage_with_transfer_outgoing_messages.any.js create mode 100644 testing/web-platform/tests/webmessaging/META.yml create mode 100644 testing/web-platform/tests/webmessaging/MessageEvent-trusted.any.js create mode 100644 testing/web-platform/tests/webmessaging/MessageEvent-trusted.window.js create mode 100644 testing/web-platform/tests/webmessaging/MessageEvent.any.js create mode 100644 testing/web-platform/tests/webmessaging/MessageEvent_onmessage_postMessage_infinite_loop.html create mode 100644 testing/web-platform/tests/webmessaging/MessageEvent_properties.htm create mode 100644 testing/web-platform/tests/webmessaging/MessagePort_initial_disabled.any.js create mode 100644 testing/web-platform/tests/webmessaging/MessagePort_onmessage_start.any.js create mode 100644 testing/web-platform/tests/webmessaging/README.md create mode 100644 testing/web-platform/tests/webmessaging/Transferred_objects_unusable.sub.htm create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/basics.any.js create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/blobs.html create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/cross-origin.html create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/cross-partition.https.tentative.html create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/detached-iframe.html create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/interface.any.js create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/opaque-origin.html create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/ordering.html create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/origin.window.js create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/resources/cross-origin.html create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/resources/ordering.html create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/resources/origin.html create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/resources/sandboxed.html create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/resources/service-worker.js create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/resources/worker.js create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/sandbox.html create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/service-worker.https.html create mode 100644 testing/web-platform/tests/webmessaging/broadcastchannel/workers.html create mode 100644 testing/web-platform/tests/webmessaging/event.data.sub.htm create mode 100644 testing/web-platform/tests/webmessaging/event.origin.sub.htm create mode 100644 testing/web-platform/tests/webmessaging/event.ports.sub.htm create mode 100644 testing/web-platform/tests/webmessaging/event.source.htm create mode 100644 testing/web-platform/tests/webmessaging/event.source.xorigin.sub.htm create mode 100644 testing/web-platform/tests/webmessaging/message-channels/basics.any.js create mode 100644 testing/web-platform/tests/webmessaging/message-channels/close.any.js create mode 100644 testing/web-platform/tests/webmessaging/message-channels/cross-document.html create mode 100644 testing/web-platform/tests/webmessaging/message-channels/detached-iframe.window.js create mode 100644 testing/web-platform/tests/webmessaging/message-channels/dictionary-transferrable.any.js create mode 100644 testing/web-platform/tests/webmessaging/message-channels/implied-start.any.js create mode 100644 testing/web-platform/tests/webmessaging/message-channels/no-start.any.js create mode 100644 testing/web-platform/tests/webmessaging/message-channels/resources/cross-document-1.html create mode 100644 testing/web-platform/tests/webmessaging/message-channels/resources/cross-document-2.html create mode 100644 testing/web-platform/tests/webmessaging/message-channels/user-activation.tentative.any.js create mode 100644 testing/web-platform/tests/webmessaging/message-channels/worker-post-after-close.any.js create mode 100644 testing/web-platform/tests/webmessaging/message-channels/worker.any.js create mode 100644 testing/web-platform/tests/webmessaging/messageerror.html create mode 100644 testing/web-platform/tests/webmessaging/multi-globals/broadcastchannel-current.sub.html create mode 100644 testing/web-platform/tests/webmessaging/multi-globals/broadcastchannel-incumbent.sub.html create mode 100644 testing/web-platform/tests/webmessaging/multi-globals/messageport-current.html create mode 100644 testing/web-platform/tests/webmessaging/multi-globals/messageport-incumbent.html create mode 100644 testing/web-platform/tests/webmessaging/multi-globals/support/current-document-domain.sub.html create mode 100644 testing/web-platform/tests/webmessaging/multi-globals/support/current.html create mode 100644 testing/web-platform/tests/webmessaging/multi-globals/support/incumbent-document-domain.sub.html create mode 100644 testing/web-platform/tests/webmessaging/multi-globals/support/incumbent.html create mode 100644 testing/web-platform/tests/webmessaging/postMessage_ArrayBuffer.sub.htm create mode 100644 testing/web-platform/tests/webmessaging/postMessage_CryptoKey_insecure.sub.html create mode 100644 testing/web-platform/tests/webmessaging/postMessage_Date.sub.htm create mode 100644 testing/web-platform/tests/webmessaging/postMessage_Document.htm create mode 100644 testing/web-platform/tests/webmessaging/postMessage_Function.htm create mode 100644 testing/web-platform/tests/webmessaging/postMessage_MessagePorts_sorigin.htm create mode 100644 testing/web-platform/tests/webmessaging/postMessage_MessagePorts_xorigin.sub.htm create mode 100644 testing/web-platform/tests/webmessaging/postMessage_MessagePorts_xsite.sub.window.js create mode 100644 testing/web-platform/tests/webmessaging/postMessage_arrays.sub.htm create mode 100644 testing/web-platform/tests/webmessaging/postMessage_asterisk_xorigin.sub.htm create mode 100644 testing/web-platform/tests/webmessaging/postMessage_cross_domain_image_transfer_2d.sub.htm create mode 100644 testing/web-platform/tests/webmessaging/postMessage_crosssite.sub.htm create mode 100644 testing/web-platform/tests/webmessaging/postMessage_dup_transfer_objects.htm create mode 100644 testing/web-platform/tests/webmessaging/postMessage_invalid_targetOrigin.htm create mode 100644 testing/web-platform/tests/webmessaging/postMessage_objects.sub.htm create mode 100644 testing/web-platform/tests/webmessaging/postMessage_origin_mismatch.sub.htm create mode 100644 testing/web-platform/tests/webmessaging/postMessage_origin_mismatch_xorigin.sub.htm create mode 100644 testing/web-platform/tests/webmessaging/postMessage_solidus_sorigin.htm create mode 100644 testing/web-platform/tests/webmessaging/postMessage_solidus_xorigin.sub.htm create mode 100644 testing/web-platform/tests/webmessaging/resources/post-cryptokey-to-opener.html create mode 100644 testing/web-platform/tests/webmessaging/resources/transfer-arraybuffer-to-parent.html create mode 100644 testing/web-platform/tests/webmessaging/support/ChildWindowPostMessage.htm create mode 100644 testing/web-platform/tests/webmessaging/support/MessageEvent-trusted-worker.js create mode 100644 testing/web-platform/tests/webmessaging/support/compare.js create mode 100644 testing/web-platform/tests/webmessaging/support/cross-domain-image-receive.htm create mode 100644 testing/web-platform/tests/webmessaging/with-options/broken-origin.html create mode 100644 testing/web-platform/tests/webmessaging/with-options/host-specific-origin.html create mode 100644 testing/web-platform/tests/webmessaging/with-options/message-channel-transferable.html create mode 100644 testing/web-platform/tests/webmessaging/with-options/no-target-origin.html create mode 100644 testing/web-platform/tests/webmessaging/with-options/null-transfer.html create mode 100644 testing/web-platform/tests/webmessaging/with-options/one-arg.html create mode 100644 testing/web-platform/tests/webmessaging/with-options/slash-origin.html create mode 100644 testing/web-platform/tests/webmessaging/with-options/undefined-transferable.html create mode 100644 testing/web-platform/tests/webmessaging/with-options/unknown-parameter.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/001.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/002.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/003.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/004.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/005.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/006.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/007.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/010.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/011.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/012.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/013.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/014.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/015.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/016.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/017.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/018.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/019.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/020.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/021.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/023.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/024.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/025.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/026.html create mode 100644 testing/web-platform/tests/webmessaging/with-ports/027.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/001.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/002.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/003.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/004.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/005.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/006.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/007.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/009.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/010.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/011.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/012.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/013.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/014.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/015.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/016.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/017.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/018.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/019-1.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/019.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/020-1.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/020.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/021.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/023.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/024.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/025-1.js create mode 100644 testing/web-platform/tests/webmessaging/without-ports/025.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/026.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/027.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/028.html create mode 100644 testing/web-platform/tests/webmessaging/without-ports/029.html create mode 100644 testing/web-platform/tests/webmessaging/worker_postMessage_user_activation.js create mode 100644 testing/web-platform/tests/webmessaging/worker_postMessage_user_activation.tentative.html (limited to 'testing/web-platform/tests/webmessaging') diff --git a/testing/web-platform/tests/webmessaging/Channel_postMessage_Blob.any.js b/testing/web-platform/tests/webmessaging/Channel_postMessage_Blob.any.js new file mode 100644 index 0000000000..fce814f588 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/Channel_postMessage_Blob.any.js @@ -0,0 +1,33 @@ +// META: title=postMessage() with a Blob +// META: script=/common/gc.js + + var TARGET = null; + var SOURCE = null; + var description = "Messages can contain Blobs."; + + var t = async_test("Test Description: " + description); + + var channel = new MessageChannel(); + SOURCE = channel.port1; + TARGET = channel.port2; + TARGET.start(); + TARGET.addEventListener("message", t.step_func(TestMessageEvent), true); + + (function() { + SOURCE.postMessage({blob: new Blob(['foo', 'bar'])}); + })(); + garbageCollect(); + + function TestMessageEvent(evt) + { + assert_true('blob' in evt.data); + assert_true(evt.data.blob instanceof Blob); + assert_equals(evt.data.blob.size, 6); + const reader = new FileReader(); + reader.onerror = t.unreached_func('Reading blob failed'); + reader.onload = t.step_func(() => { + assert_equals(reader.result, 'foobar'); + t.done(); + }); + reader.readAsText(evt.data.blob); + } diff --git a/testing/web-platform/tests/webmessaging/Channel_postMessage_DataCloneErr.any.js b/testing/web-platform/tests/webmessaging/Channel_postMessage_DataCloneErr.any.js new file mode 100644 index 0000000000..048820fa6b --- /dev/null +++ b/testing/web-platform/tests/webmessaging/Channel_postMessage_DataCloneErr.any.js @@ -0,0 +1,14 @@ +// META: title=postMessage() with a host object raises DataCloneError + + var description = "Throw a DataCloneError when a host object (e.g. a DOM node) is used with postMessage."; + + test(function() + { + var channel = new MessageChannel(); + channel.port1.start(); + + assert_throws_dom("DATA_CLONE_ERR", function() + { + channel.port1.postMessage(globalThis); + }); + }, description); diff --git a/testing/web-platform/tests/webmessaging/Channel_postMessage_clone_port.any.js b/testing/web-platform/tests/webmessaging/Channel_postMessage_clone_port.any.js new file mode 100644 index 0000000000..3dcb902b77 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/Channel_postMessage_clone_port.any.js @@ -0,0 +1,31 @@ +// META: title=postMessage(): clone a port + + var OriginalPort = null; + var ClonedPort = null; + var description = "Test Description: When the user agent is to clone a port original port, with " + + "the clone being owned by owner, it must return a new MessagePort object"; + + var t = async_test("Test Description: " + description); + + var ChannelA = new MessageChannel(); + var ChannelB = new MessageChannel(); + OriginalPort = ChannelB.port2; + + ChannelA.port2.onmessage = t.step_func(function(evt) + { + if(evt.data == "ports") + { + ClonedPort = evt.ports[0]; + + assert_not_equals(ClonedPort, OriginalPort, "new cloned port object should not equal to the original port!"); + + ClonedPort.onmessage = function(e) + { + test(function(){ assert_equals(e.data, "ping"); }, "Data sent through remote port is received by the new cloned port"); + t.done(); + } + } + }); + + ChannelA.port1.postMessage("ports", [OriginalPort]); + ChannelB.port1.postMessage("ping"); diff --git a/testing/web-platform/tests/webmessaging/Channel_postMessage_clone_port_error.any.js b/testing/web-platform/tests/webmessaging/Channel_postMessage_clone_port_error.any.js new file mode 100644 index 0000000000..cbee47270c --- /dev/null +++ b/testing/web-platform/tests/webmessaging/Channel_postMessage_clone_port_error.any.js @@ -0,0 +1,14 @@ +// META: title=postMessage() DataCloneError: cloning source port + + var description = "Test Description: Throw a DataCloneError if transfer array in postMessage contains source port."; + + test(function() + { + var channel = new MessageChannel(); + channel.port1.start(); + + assert_throws_dom("DATA_CLONE_ERR", function() + { + channel.port1.postMessage("ports", [channel.port1]); + }); + }, description); diff --git a/testing/web-platform/tests/webmessaging/Channel_postMessage_event_properties.any.js b/testing/web-platform/tests/webmessaging/Channel_postMessage_event_properties.any.js new file mode 100644 index 0000000000..0fd8c7e90a --- /dev/null +++ b/testing/web-platform/tests/webmessaging/Channel_postMessage_event_properties.any.js @@ -0,0 +1,24 @@ +// META: title=postMessage(): MessageEvent properties + + var TargetPort = null; + var description = "The postMessage() method - Create an event that uses the MessageEvent interface, " + + "with the name message, which does not bubble and is not cancelable."; + + var t = async_test("Test Description: " + description); + + var channel = new MessageChannel(); + + TargetPort = channel.port2; + TargetPort.start(); + TargetPort.addEventListener("message", t.step_func(TestMessageEvent), true); + + channel.port1.postMessage("ping"); + + function TestMessageEvent(evt) + { + ExpectedResult = [true, "message", false, false]; + ActualResult = [(evt instanceof MessageEvent), evt.type, evt.bubbles, evt.cancelable]; + + assert_array_equals(ActualResult, ExpectedResult); + t.done(); + } diff --git a/testing/web-platform/tests/webmessaging/Channel_postMessage_ports_readonly_array.any.js b/testing/web-platform/tests/webmessaging/Channel_postMessage_ports_readonly_array.any.js new file mode 100644 index 0000000000..032a54e710 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/Channel_postMessage_ports_readonly_array.any.js @@ -0,0 +1,28 @@ +// META: title=postMessage(): read-only ports array + + "use strict"; + + var TargetPort = null; + var description = "The postMessage() method - Make new ports into a read only array."; + + var t = async_test("Test Description: " + description); + + var channel = new MessageChannel(); + + TargetPort = channel.port2; + TargetPort.start(); + TargetPort.addEventListener("message", t.step_func(TestMessageEvent), true); + + var channel2 = new MessageChannel(); + + channel.port1.postMessage("ports", [channel2.port1]); + + function TestMessageEvent(evt) + { + var channel3 = new MessageChannel(); + assert_throws_js(TypeError, () => { + evt.ports.push(channel3.port1); + }, "ports is a frozen object"); + assert_equals(evt.ports.length, 1, "ports is a read only array with length == 1."); + t.done(); + } diff --git a/testing/web-platform/tests/webmessaging/Channel_postMessage_target_source.any.js b/testing/web-platform/tests/webmessaging/Channel_postMessage_target_source.any.js new file mode 100644 index 0000000000..6b7fc7f20d --- /dev/null +++ b/testing/web-platform/tests/webmessaging/Channel_postMessage_target_source.any.js @@ -0,0 +1,23 @@ +// META: title=postMessage(): target port and source port + + var TARGET = null; + var SOURCE = null; + var description = "The postMessage() method - Let target port be the port with which source " + + "port is entangled, if any."; + + var t = async_test("Test Description: " + description); + + var channel = new MessageChannel(); + SOURCE = channel.port1; + TARGET = channel.port2; + TARGET.start(); + TARGET.addEventListener("message", t.step_func(TestMessageEvent), true); + + SOURCE.postMessage("ping"); + + function TestMessageEvent(evt) + { + assert_equals(evt.target, TARGET); + assert_not_equals(evt.target, SOURCE); + t.done(); + } diff --git a/testing/web-platform/tests/webmessaging/Channel_postMessage_transfer_xsite_incoming_messages.window.js b/testing/web-platform/tests/webmessaging/Channel_postMessage_transfer_xsite_incoming_messages.window.js new file mode 100644 index 0000000000..23237ae155 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/Channel_postMessage_transfer_xsite_incoming_messages.window.js @@ -0,0 +1,32 @@ +// META: script=/common/get-host-info.sub.js + +async_test(function(t) { + var channel1 = new MessageChannel(); + var host = get_host_info(); + let iframe = document.createElement('iframe'); + iframe.src = host.HTTP_NOTSAMESITE_ORIGIN + "/webmessaging/support/ChildWindowPostMessage.htm"; + document.body.appendChild(iframe); + var TARGET = document.querySelector("iframe").contentWindow; + iframe.onload = t.step_func(function() { + // Enable the port. + channel1.port1.onmessage = t.step_func(function (evt) { + assert_equals(Number(evt.data), 0); + + // Send a message, expecting it to be received in the iframe. + channel1.port2.postMessage(1) + + // Transfer the port. + TARGET.postMessage("ports", "*", [channel1.port1]); + }); + + // Send a message, expecting it to be received here. + channel1.port2.postMessage(0) + + channel1.port2.onmessage = t.step_func(function (evt) { + assert_equals(Number(evt.data), 1); + t.done(); + }); + }); +}, `Tasks enqueued on the port-message-queue of an enabled port, + are transferred along with the port, when the transfer happens in the same task + during which postMessage is called`); diff --git a/testing/web-platform/tests/webmessaging/Channel_postMessage_with_transfer_entangled.any.js b/testing/web-platform/tests/webmessaging/Channel_postMessage_with_transfer_entangled.any.js new file mode 100644 index 0000000000..2226b27844 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/Channel_postMessage_with_transfer_entangled.any.js @@ -0,0 +1,36 @@ +async_test(function(t) { + var channel1 = new MessageChannel(); + var channel2 = new MessageChannel(); + + // One, send a message. + channel1.port1.postMessage(1); + + // Two, transfer both ports. + channel2.port1.postMessage("transfer", [channel1.port1]); + channel2.port1.postMessage("transfer", [channel1.port2]); + + var transfer_counter = 0; + var sender; + channel2.port2.onmessage = t.step_func(function (evt) { + if (transfer_counter == 0) { + sender = evt.ports[0]; + transfer_counter = 1; + } else { + sender.postMessage(2); + var counter = 0; + evt.ports[0].onmessage = t.step_func(function (evt) { + if (counter == 0) { + assert_equals(evt.data, 1); + counter = 1; + } else if (counter == 1) { + assert_equals(evt.data, 2); + counter = 2; + } else { + assert_equals(evt.data, 3); + t.done(); + } + }); + sender.postMessage(3); + } + }); +}, "An entangled port transferred to the same origin receives messages in order"); diff --git a/testing/web-platform/tests/webmessaging/Channel_postMessage_with_transfer_incoming_messages.any.js b/testing/web-platform/tests/webmessaging/Channel_postMessage_with_transfer_incoming_messages.any.js new file mode 100644 index 0000000000..fe2e96220d --- /dev/null +++ b/testing/web-platform/tests/webmessaging/Channel_postMessage_with_transfer_incoming_messages.any.js @@ -0,0 +1,32 @@ +async_test(function(t) { + var channel1 = new MessageChannel(); + var channel2 = new MessageChannel(); + var channel3 = new MessageChannel(); + channel2.port2.onmessage = t.step_func(function (evt) { + channel3.port1.onmessage = t.step_func(function (evt) { + var counter = 0; + evt.ports[0].onmessage = t.step_func(function (evt) { + if (counter == 0) { + assert_equals(evt.data, "First"); + counter = 1; + } else if (counter == 1) { + assert_equals(evt.data, "Second"); + counter = 2; + } else if (counter == 2) { + assert_equals(evt.data, "Third"); + counter = 3; + } else if (counter == 3) { + assert_equals(evt.data, "Fourth"); + t.done(); + } + }); + channel1.port2.postMessage("Fourth"); + }); + channel1.port2.postMessage("Second"); + channel1.port2.postMessage("Third"); + channel3.port2.postMessage("2", evt.ports); + }); + channel1.port2.postMessage("First"); + channel2.port1.postMessage("1", [channel1.port1]); +}, `When transferring a non-enabled port mutiple times, + incoming messages sent at various transfer steps are received in order upon enablement.`); diff --git a/testing/web-platform/tests/webmessaging/Channel_postMessage_with_transfer_outgoing_messages.any.js b/testing/web-platform/tests/webmessaging/Channel_postMessage_with_transfer_outgoing_messages.any.js new file mode 100644 index 0000000000..aa80b7589c --- /dev/null +++ b/testing/web-platform/tests/webmessaging/Channel_postMessage_with_transfer_outgoing_messages.any.js @@ -0,0 +1,35 @@ + +async_test(function(t) { + var channel1 = new MessageChannel(); + var channel2 = new MessageChannel(); + var channel3 = new MessageChannel(); + channel2.port2.onmessage = t.step_func(function (evt) { + evt.ports[0].postMessage("Second"); + evt.ports[0].postMessage("Third"); + channel3.port1.onmessage = t.step_func(function (evt) { + evt.ports[0].postMessage("Fourth"); + }); + channel3.port2.postMessage("2", evt.ports); + }); + channel1.port1.postMessage("First"); + channel2.port1.postMessage("1", [channel1.port1]); + var counter = 0; + channel1.port2.onmessage = t.step_func(function (evt) { + if (counter == 0) { + assert_equals(evt.data, "First"); + counter = 1; + } else if (counter == 1) { + assert_equals(evt.data, "Second"); + counter = 2; + } + else if (counter == 2) { + assert_equals(evt.data, "Third"); + counter = 3; + } + else if (counter == 3) { + assert_equals(evt.data, "Fourth"); + t.done(); + } + }); +}, `When transferring a port, + outgoing messages sent at each transfer step are received in order by the entangled port.`); diff --git a/testing/web-platform/tests/webmessaging/META.yml b/testing/web-platform/tests/webmessaging/META.yml new file mode 100644 index 0000000000..95d5071171 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/META.yml @@ -0,0 +1,6 @@ +spec: https://html.spec.whatwg.org/multipage/web-messaging.html +suggested_reviewers: + - zqzhang + - jdm + - mkruisselbrink + - annevk diff --git a/testing/web-platform/tests/webmessaging/MessageEvent-trusted.any.js b/testing/web-platform/tests/webmessaging/MessageEvent-trusted.any.js new file mode 100644 index 0000000000..84187eb571 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/MessageEvent-trusted.any.js @@ -0,0 +1,32 @@ +// META: title=MessagePort message events are trusted + +// See also: +// - https://github.com/whatwg/html/issues/1602 +// - https://github.com/whatwg/html/pull/1935 + +"use strict"; + +async_test(t => { + assert_true("MessageChannel" in self, "The browser must support MessageChannel"); + + const channel = new MessageChannel(); + + channel.port2.onmessage = t.step_func_done(e => { + assert_equals(e.isTrusted, true); + }); + + channel.port1.postMessage("ping"); +}, "With a MessageChannel and its MessagePorts"); + +async_test(t => { + assert_true("BroadcastChannel" in self, "The browser must support BroadcastChannel"); + + const channel = new BroadcastChannel("channel name"); + + channel.onmessage = t.step_func_done(e => { + assert_equals(e.isTrusted, true); + }); + + new Worker("support/MessageEvent-trusted-worker.js"); +}, "With a BroadcastChannel"); + diff --git a/testing/web-platform/tests/webmessaging/MessageEvent-trusted.window.js b/testing/web-platform/tests/webmessaging/MessageEvent-trusted.window.js new file mode 100644 index 0000000000..11cf48beed --- /dev/null +++ b/testing/web-platform/tests/webmessaging/MessageEvent-trusted.window.js @@ -0,0 +1,9 @@ +// META: title=MessagePort message events are trusted with window + +async_test(t => { + window.onmessage = t.step_func_done(e => { + assert_equals(e.isTrusted, true); + }); + + window.postMessage("ping", "*"); +}, "With window"); diff --git a/testing/web-platform/tests/webmessaging/MessageEvent.any.js b/testing/web-platform/tests/webmessaging/MessageEvent.any.js new file mode 100644 index 0000000000..0fb2636911 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/MessageEvent.any.js @@ -0,0 +1,22 @@ +// META: title=MessageEvent + +var prefixes = ['moz', 'ms', 'o', 'webkit']; +prefixes.forEach(function(prefix) { + var name = prefix + "InitMessageEvent"; + + test(function() { + assert_false(name in MessageEvent.prototype); + }, name + " on the prototype"); + + test(function() { + var event = new MessageEvent("message"); + assert_false(name in event); + }, name + " on the instance"); +}); + +test(function() { + var event = new MessageEvent("message"); + assert_throws_js(TypeError, function() { + event.initMessageEvent(); + }, "Not enough arguments to initMessageEvent"); +}, "initMessageEvent with no arguments"); diff --git a/testing/web-platform/tests/webmessaging/MessageEvent_onmessage_postMessage_infinite_loop.html b/testing/web-platform/tests/webmessaging/MessageEvent_onmessage_postMessage_infinite_loop.html new file mode 100644 index 0000000000..179bc0cc4a --- /dev/null +++ b/testing/web-platform/tests/webmessaging/MessageEvent_onmessage_postMessage_infinite_loop.html @@ -0,0 +1,31 @@ + + + +MessageEvent: onmessage infinite loop + + + + + diff --git a/testing/web-platform/tests/webmessaging/MessageEvent_properties.htm b/testing/web-platform/tests/webmessaging/MessageEvent_properties.htm new file mode 100644 index 0000000000..389add98d1 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/MessageEvent_properties.htm @@ -0,0 +1,32 @@ + + + + MessageEvent interface and properties + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/MessagePort_initial_disabled.any.js b/testing/web-platform/tests/webmessaging/MessagePort_initial_disabled.any.js new file mode 100644 index 0000000000..b897858175 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/MessagePort_initial_disabled.any.js @@ -0,0 +1,10 @@ +// META: title=MessageChannel: port message queue is initially disabled + +// TODO: duplicate of ./message-channels/no-start.any.js? + +async_test(function(t) { + var channel = new MessageChannel(); + channel.port2.addEventListener("message", t.unreached_func(), true); + channel.port1.postMessage("ping"); + setTimeout(t.step_func_done(), 100); +}); diff --git a/testing/web-platform/tests/webmessaging/MessagePort_onmessage_start.any.js b/testing/web-platform/tests/webmessaging/MessagePort_onmessage_start.any.js new file mode 100644 index 0000000000..7ba3a37210 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/MessagePort_onmessage_start.any.js @@ -0,0 +1,10 @@ +// META: title=MessageChannel: port.onmessage enables message queue + +// TODO: duplicate of ./message-channels/implied-start.any.js? + +async_test(function(t) { + var channel = new MessageChannel(); + channel.port2.onmessage = t.step_func_done(); + channel.port1.postMessage("ping"); + t.step_timeout(t.unreached_func(), 1000); +}); diff --git a/testing/web-platform/tests/webmessaging/README.md b/testing/web-platform/tests/webmessaging/README.md new file mode 100644 index 0000000000..0b81aa0658 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/README.md @@ -0,0 +1,2 @@ +These are the cross-document messaging (`postMessage()`) tests for the +[cross-document messaging chapter of the HTML Standard](https://html.spec.whatwg.org/multipage/comms.html#web-messaging). diff --git a/testing/web-platform/tests/webmessaging/Transferred_objects_unusable.sub.htm b/testing/web-platform/tests/webmessaging/Transferred_objects_unusable.sub.htm new file mode 100644 index 0000000000..55c3dbdba1 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/Transferred_objects_unusable.sub.htm @@ -0,0 +1,60 @@ + + + + Transferred objects are no longer usable on the sending side + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/basics.any.js b/testing/web-platform/tests/webmessaging/broadcastchannel/basics.any.js new file mode 100644 index 0000000000..eec09d65a3 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/basics.any.js @@ -0,0 +1,128 @@ +test(function() { + assert_throws_js( + TypeError, + () => BroadcastChannel(""), + "Calling BroadcastChannel constructor without 'new' must throw" + ); +}, "BroadcastChannel constructor called as normal function"); + +async_test(t => { + let c1 = new BroadcastChannel('eventType'); + let c2 = new BroadcastChannel('eventType'); + + c2.onmessage = t.step_func(e => { + assert_true(e instanceof MessageEvent); + assert_equals(e.target, c2); + assert_equals(e.type, 'message'); + assert_equals(e.origin, location.origin, 'origin'); + assert_equals(e.data, 'hello world'); + assert_equals(e.source, null, 'source'); + t.done(); + }); + c1.postMessage('hello world'); + }, 'postMessage results in correct event'); + +async_test(t => { + let c1 = new BroadcastChannel('order'); + let c2 = new BroadcastChannel('order'); + let c3 = new BroadcastChannel('order'); + + let events = []; + let doneCount = 0; + let handler = t.step_func(e => { + events.push(e); + if (e.data == 'done') { + doneCount++; + if (doneCount == 2) { + assert_equals(events.length, 6); + assert_equals(events[0].target, c2, 'target for event 0'); + assert_equals(events[0].data, 'from c1'); + assert_equals(events[1].target, c3, 'target for event 1'); + assert_equals(events[1].data, 'from c1'); + assert_equals(events[2].target, c1, 'target for event 2'); + assert_equals(events[2].data, 'from c3'); + assert_equals(events[3].target, c2, 'target for event 3'); + assert_equals(events[3].data, 'from c3'); + assert_equals(events[4].target, c1, 'target for event 4'); + assert_equals(events[4].data, 'done'); + assert_equals(events[5].target, c3, 'target for event 5'); + assert_equals(events[5].data, 'done'); + t.done(); + } + } + }); + c1.onmessage = handler; + c2.onmessage = handler; + c3.onmessage = handler; + + c1.postMessage('from c1'); + c3.postMessage('from c3'); + c2.postMessage('done'); + }, 'messages are delivered in port creation order'); + +async_test(t => { + let c1 = new BroadcastChannel('closed'); + let c2 = new BroadcastChannel('closed'); + let c3 = new BroadcastChannel('closed'); + + c2.onmessage = t.unreached_func(); + c2.close(); + c3.onmessage = t.step_func(() => t.done()); + c1.postMessage('test'); + }, 'messages aren\'t delivered to a closed port'); + + async_test(t => { + let c1 = new BroadcastChannel('closed'); + let c2 = new BroadcastChannel('closed'); + let c3 = new BroadcastChannel('closed'); + + c2.onmessage = t.unreached_func(); + c3.onmessage = t.step_func(() => t.done()); + c1.postMessage('test'); + c2.close(); +}, 'messages aren\'t delivered to a port closed after calling postMessage.'); + +async_test(t => { + let c1 = new BroadcastChannel('create-in-onmessage'); + let c2 = new BroadcastChannel('create-in-onmessage'); + + c2.onmessage = t.step_func(e => { + assert_equals(e.data, 'first'); + c2.close(); + let c3 = new BroadcastChannel('create-in-onmessage'); + c3.onmessage = t.step_func(event => { + assert_equals(event.data, 'done'); + t.done(); + }); + c1.postMessage('done'); + }); + c1.postMessage('first'); + c2.postMessage('second'); + }, 'closing and creating channels during message delivery works correctly'); + +async_test(t => { + let c1 = new BroadcastChannel('close-in-onmessage'); + let c2 = new BroadcastChannel('close-in-onmessage'); + let c3 = new BroadcastChannel('close-in-onmessage'); + let events = []; + c1.onmessage = e => events.push('c1: ' + e.data); + c2.onmessage = e => events.push('c2: ' + e.data); + c3.onmessage = e => events.push('c3: ' + e.data); + + // c2 closes itself when it receives the first message + c2.addEventListener('message', e => { + c2.close(); + }); + + c3.addEventListener('message', t.step_func(e => { + if (e.data == 'done') { + assert_array_equals(events, [ + 'c2: first', + 'c3: first', + 'c3: done']); + t.done(); + } + })); + c1.postMessage('first'); + c1.postMessage('done'); + }, 'Closing a channel in onmessage prevents already queued tasks from firing onmessage events'); diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/blobs.html b/testing/web-platform/tests/webmessaging/broadcastchannel/blobs.html new file mode 100644 index 0000000000..ab5096b63c --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/blobs.html @@ -0,0 +1,82 @@ + + + + + + diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/cross-origin.html b/testing/web-platform/tests/webmessaging/broadcastchannel/cross-origin.html new file mode 100644 index 0000000000..ee4b2f21c8 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/cross-origin.html @@ -0,0 +1,38 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/cross-partition.https.tentative.html b/testing/web-platform/tests/webmessaging/broadcastchannel/cross-partition.https.tentative.html new file mode 100644 index 0000000000..4e91da5546 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/cross-partition.https.tentative.html @@ -0,0 +1,356 @@ + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/detached-iframe.html b/testing/web-platform/tests/webmessaging/broadcastchannel/detached-iframe.html new file mode 100644 index 0000000000..b9b06c3a46 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/detached-iframe.html @@ -0,0 +1,174 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/interface.any.js b/testing/web-platform/tests/webmessaging/broadcastchannel/interface.any.js new file mode 100644 index 0000000000..35e09d34b4 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/interface.any.js @@ -0,0 +1,65 @@ +test(() => assert_throws_js(TypeError, () => new BroadcastChannel()), + 'Should throw if no name is provided'); + +test(() => { + let c = new BroadcastChannel(null); + assert_equals(c.name, 'null'); + }, 'Null name should not throw'); + +test(() => { + let c = new BroadcastChannel(undefined); + assert_equals(c.name, 'undefined'); + }, 'Undefined name should not throw'); + +test(() => { + let c = new BroadcastChannel('fooBar'); + assert_equals(c.name, 'fooBar'); + }, 'Non-empty name should not throw'); + +test(() => { + let c = new BroadcastChannel(123); + assert_equals(c.name, '123'); + }, 'Non-string name should not throw'); + +test(() => { + let c = new BroadcastChannel(''); + assert_throws_js(TypeError, () => c.postMessage()); + }, 'postMessage without parameters should throw'); + +test(() => { + let c = new BroadcastChannel(''); + c.postMessage(null); + }, 'postMessage with null should not throw'); + +test(() => { + let c = new BroadcastChannel(''); + c.close(); + }, 'close should not throw'); + +test(() => { + let c = new BroadcastChannel(''); + c.close(); + c.close(); + }, 'close should not throw when called multiple times'); + +test(() => { + let c = new BroadcastChannel(''); + c.close(); + assert_throws_dom('InvalidStateError', () => c.postMessage('')); + }, 'postMessage after close should throw'); + +test(() => { + let c = new BroadcastChannel(''); + assert_not_equals(c.onmessage, undefined); + }, 'BroadcastChannel should have an onmessage event'); + +test(() => { + let c = new BroadcastChannel(''); + assert_throws_dom('DataCloneError', () => c.postMessage(Symbol())); + }, 'postMessage should throw with uncloneable data'); + +test(() => { + let c = new BroadcastChannel(''); + c.close(); + assert_throws_dom('InvalidStateError', () => c.postMessage(Symbol())); + }, 'postMessage should throw InvalidStateError after close, even with uncloneable data'); diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/opaque-origin.html b/testing/web-platform/tests/webmessaging/broadcastchannel/opaque-origin.html new file mode 100644 index 0000000000..e09d935244 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/opaque-origin.html @@ -0,0 +1,193 @@ + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/ordering.html b/testing/web-platform/tests/webmessaging/broadcastchannel/ordering.html new file mode 100644 index 0000000000..2d521b9e0c --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/ordering.html @@ -0,0 +1,116 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/origin.window.js b/testing/web-platform/tests/webmessaging/broadcastchannel/origin.window.js new file mode 100644 index 0000000000..7e9d602af1 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/origin.window.js @@ -0,0 +1,10 @@ +async_test(t => { + const crossOriginURL = new URL("resources/origin.html", self.location.href).href.replace("://", "://天気の良い日."), + frame = document.createElement("iframe"); + frame.src = crossOriginURL; + document.body.appendChild(frame); + t.add_cleanup(() => frame.remove()); + self.onmessage = t.step_func_done(e => { + assert_equals(e.data, self.origin.replace("://", "://xn--n8j6ds53lwwkrqhv28a.")); + }); +}, "Serialization of BroadcastChannel origin"); diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/resources/cross-origin.html b/testing/web-platform/tests/webmessaging/broadcastchannel/resources/cross-origin.html new file mode 100644 index 0000000000..5078b6fc8e --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/resources/cross-origin.html @@ -0,0 +1,15 @@ + + diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/resources/ordering.html b/testing/web-platform/tests/webmessaging/broadcastchannel/resources/ordering.html new file mode 100644 index 0000000000..b7f12d865a --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/resources/ordering.html @@ -0,0 +1,78 @@ + + diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/resources/origin.html b/testing/web-platform/tests/webmessaging/broadcastchannel/resources/origin.html new file mode 100644 index 0000000000..f57d582bbb --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/resources/origin.html @@ -0,0 +1,8 @@ + diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/resources/sandboxed.html b/testing/web-platform/tests/webmessaging/broadcastchannel/resources/sandboxed.html new file mode 100644 index 0000000000..e32962cdfd --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/resources/sandboxed.html @@ -0,0 +1,10 @@ + + + diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/resources/service-worker.js b/testing/web-platform/tests/webmessaging/broadcastchannel/resources/service-worker.js new file mode 100644 index 0000000000..a3d17b9c65 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/resources/service-worker.js @@ -0,0 +1,15 @@ +let promise_func = null; +let promise = new Promise(resolve => promise_func = resolve); + +const SERVICE_WORKER_TEST_CHANNEL_NAME = 'service worker'; +const bc3 = new BroadcastChannel(SERVICE_WORKER_TEST_CHANNEL_NAME); +bc3.onmessage = e => { + bc3.postMessage('done'); + promise_func(); +}; +bc3.postMessage('from worker'); + +// Ensure that the worker stays alive for the duration of the test +self.addEventListener('install', evt => { + evt.waitUntil(promise); +}); diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/resources/worker.js b/testing/web-platform/tests/webmessaging/broadcastchannel/resources/worker.js new file mode 100644 index 0000000000..ee2d51a254 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/resources/worker.js @@ -0,0 +1,37 @@ +importScripts("/common/gc.js"); + +var c; + +async function handler(e, reply) { + if (e.data.ping) { + c.postMessage(e.data.ping); + return; + } + if (e.data.blob) { + (() => { + c.postMessage({blob: new Blob(e.data.blob)}); + })(); + await garbageCollect(); + } + c = new BroadcastChannel(e.data.channel); + let messages = []; + c.onmessage = e => { + if (e.data === 'ready') { + // Ignore any 'ready' messages from the other thread since there could + // be some race conditions between this BroadcastChannel instance + // being created / ready to receive messages and the message being sent. + return; + } + messages.push(e.data); + if (e.data == 'done') + reply(messages); + }; + c.postMessage('from worker'); +} + +onmessage = e => handler(e, postMessage); + +onconnect = e => { + let port = e.ports[0]; + port.onmessage = e => handler(e, msg => port.postMessage(msg)); +}; diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/sandbox.html b/testing/web-platform/tests/webmessaging/broadcastchannel/sandbox.html new file mode 100644 index 0000000000..aedf3c0d6f --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/sandbox.html @@ -0,0 +1,16 @@ + + +Creating BroadcastChannel in an opaque origin + + + + + + diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/service-worker.https.html b/testing/web-platform/tests/webmessaging/broadcastchannel/service-worker.https.html new file mode 100644 index 0000000000..d605434ae1 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/service-worker.https.html @@ -0,0 +1,47 @@ + + + + + diff --git a/testing/web-platform/tests/webmessaging/broadcastchannel/workers.html b/testing/web-platform/tests/webmessaging/broadcastchannel/workers.html new file mode 100644 index 0000000000..8b55492f3c --- /dev/null +++ b/testing/web-platform/tests/webmessaging/broadcastchannel/workers.html @@ -0,0 +1,375 @@ + + + + + diff --git a/testing/web-platform/tests/webmessaging/event.data.sub.htm b/testing/web-platform/tests/webmessaging/event.data.sub.htm new file mode 100644 index 0000000000..6858ef4c69 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/event.data.sub.htm @@ -0,0 +1,44 @@ + + + + event.data returns the data of the message + + + + +
+ + + +
+ + +
+ + diff --git a/testing/web-platform/tests/webmessaging/event.origin.sub.htm b/testing/web-platform/tests/webmessaging/event.origin.sub.htm new file mode 100644 index 0000000000..5b1ab3e3c3 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/event.origin.sub.htm @@ -0,0 +1,66 @@ + + + + event.origin returns the origin of the message + + + + +
+ +
+ + +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/event.ports.sub.htm b/testing/web-platform/tests/webmessaging/event.ports.sub.htm new file mode 100644 index 0000000000..a4ca24b15e --- /dev/null +++ b/testing/web-platform/tests/webmessaging/event.ports.sub.htm @@ -0,0 +1,49 @@ + + + + event.ports returns the MessagePort array sent with the message + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/event.source.htm b/testing/web-platform/tests/webmessaging/event.source.htm new file mode 100644 index 0000000000..365a5feb47 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/event.source.htm @@ -0,0 +1,51 @@ + + + + Same-origin: event.source returns the WindowProxy of the source window + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/event.source.xorigin.sub.htm b/testing/web-platform/tests/webmessaging/event.source.xorigin.sub.htm new file mode 100644 index 0000000000..7327f78667 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/event.source.xorigin.sub.htm @@ -0,0 +1,51 @@ + + + + Corss-origin: event.source returns the WindowProxy of the source window + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/message-channels/basics.any.js b/testing/web-platform/tests/webmessaging/message-channels/basics.any.js new file mode 100644 index 0000000000..5732fb268a --- /dev/null +++ b/testing/web-platform/tests/webmessaging/message-channels/basics.any.js @@ -0,0 +1,12 @@ +// META: title=basic messagechannel test + +async_test(function(t) { + var channel = new MessageChannel(); + channel.port1.postMessage(1); + channel.port2.onmessage = t.step_func( + function(e) { + assert_equals(e.data, 1); + t.done(); + }); + channel.port2.start(); +}); diff --git a/testing/web-platform/tests/webmessaging/message-channels/close.any.js b/testing/web-platform/tests/webmessaging/message-channels/close.any.js new file mode 100644 index 0000000000..8741d894b9 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/message-channels/close.any.js @@ -0,0 +1,62 @@ +// How long (in ms) these tests should wait before deciding no further messages +// will be received. +const time_to_wait_for_messages = 100; + +async_test(t => { + const c = new MessageChannel(); + c.port1.onmessage = t.unreached_func('Should not have delivered message'); + c.port1.close(); + c.port2.postMessage('TEST'); + setTimeout(t.step_func_done(), time_to_wait_for_messages); + }, 'Message sent to closed port should not arrive.'); + +async_test(t => { + const c = new MessageChannel(); + c.port1.onmessage = t.unreached_func('Should not have delivered message'); + c.port2.close(); + c.port2.postMessage('TEST'); + setTimeout(t.step_func_done(), time_to_wait_for_messages); + }, 'Message sent from closed port should not arrive.'); + +async_test(t => { + const c = new MessageChannel(); + c.port1.onmessage = t.unreached_func('Should not have delivered message'); + c.port1.close(); + const c2 = new MessageChannel(); + c2.port1.onmessage = t.step_func(e => { + e.ports[0].postMessage('TESTMSG'); + setTimeout(t.step_func_done(), time_to_wait_for_messages); + }); + c2.port2.postMessage('TEST', [c.port2]); + }, 'Message sent to closed port from transferred port should not arrive.'); + +async_test(t => { + const c = new MessageChannel(); + let isClosed = false; + c.port1.onmessage = t.step_func_done(e => { + assert_true(isClosed); + assert_equals(e.data, 'TEST'); + }); + c.port2.postMessage('TEST'); + c.port2.close(); + isClosed = true; + }, 'Inflight messages should be delivered even when sending port is closed afterwards.'); + +async_test(t => { + const c = new MessageChannel(); + c.port1.onmessage = t.step_func_done(e => { + if (e.data == 'DONE') t.done(); + assert_equals(e.data, 'TEST'); + c.port1.close(); + }); + c.port2.postMessage('TEST'); + c.port2.postMessage('DONE'); + }, 'Close in onmessage should not cancel inflight messages.'); + +test(() => { + const c1 = new MessageChannel(); + const c2 = new MessageChannel(); + c1.port1.close(); + assert_throws_dom("DataCloneError", () => c2.port1.postMessage(null, [c1.port1])); + c2.port1.postMessage(null, [c1.port2]); +}, "close() detaches a MessagePort (but not the one its entangled with)"); diff --git a/testing/web-platform/tests/webmessaging/message-channels/cross-document.html b/testing/web-platform/tests/webmessaging/message-channels/cross-document.html new file mode 100644 index 0000000000..f4512ba5a2 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/message-channels/cross-document.html @@ -0,0 +1,22 @@ + +cross-document channel + + + +
+ diff --git a/testing/web-platform/tests/webmessaging/message-channels/detached-iframe.window.js b/testing/web-platform/tests/webmessaging/message-channels/detached-iframe.window.js new file mode 100644 index 0000000000..c19f50ff93 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/message-channels/detached-iframe.window.js @@ -0,0 +1,46 @@ +// META: title=MessageChannel in a detached iframe test +// META: script=/service-workers/service-worker/resources/test-helpers.sub.js +// META: script=/common/gc.js +// Pull in the with_iframe helper function from the service worker tests + + +const IframeAction = { + REMOVE_BEFORE_CREATION: 'remove-before-creation', + REMOVE_AFTER_CREATION: 'remove-after-creation', +}; + +async function detached_frame_test(t, action) { + const iframe = await with_iframe('about:blank'); + const iframe_MessageChannel = iframe.contentWindow.MessageChannel; + + if (action === IframeAction.REMOVE_BEFORE_CREATION) { + iframe.remove(); + } + + (() => { + const mc = new iframe_MessageChannel(); + mc.port1.postMessage("boo"); + mc.port2.onmessage = t.unreached_func("message event received"); + mc.port2.onmessageerror = t.unreached_func("message event received"); + })(); + + if (action === IframeAction.REMOVE_AFTER_CREATION) { + iframe.remove(); + } + + await garbageCollect(); + + // We are testing that neither of the above two events fire. We assume that a 2 second timeout + // is good enough. We can't use any other API for an end condition because each MessagePort has + // its own independent port message queue, which has no ordering guarantees relative to other + // APIs. + await new Promise(resolve => t.step_timeout(resolve, 2000)); +} + +promise_test(async (t) => { + return detached_frame_test(t, IframeAction.REMOVE_AFTER_CREATION); +}, 'MessageChannel created from a detached iframe should not send messages (remove after create)'); + +promise_test(async (t) => { + return detached_frame_test(t, IframeAction.REMOVE_BEFORE_CREATION); +}, 'MessageChannel created from a detached iframe should not send messages (remove before create)'); diff --git a/testing/web-platform/tests/webmessaging/message-channels/dictionary-transferrable.any.js b/testing/web-platform/tests/webmessaging/message-channels/dictionary-transferrable.any.js new file mode 100644 index 0000000000..bf49fddb99 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/message-channels/dictionary-transferrable.any.js @@ -0,0 +1,13 @@ +// META: title=basic messagechannel with transfer + +async_test(function(t) { + var channel = new MessageChannel(); + var ab = new ArrayBuffer(1); + channel.port1.postMessage(ab, {transfer: [ab]}); + channel.port2.onmessage = t.step_func( + function(e) { + assert_equals(e.data.byteLength, 1); + t.done(); + }); + channel.port2.start(); +}); diff --git a/testing/web-platform/tests/webmessaging/message-channels/implied-start.any.js b/testing/web-platform/tests/webmessaging/message-channels/implied-start.any.js new file mode 100644 index 0000000000..460d26b7e4 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/message-channels/implied-start.any.js @@ -0,0 +1,14 @@ +// META: title=onmessage implied start() + +async_test(function(t) { + var channel = new MessageChannel(); + channel.port1.postMessage(1); + channel.port2.onmessage = function() { + setTimeout(t.step_func(function() { + t.done(); + }), 50); + channel.port2.onmessage = t.step_func(function() { + assert_unreached(); + }); + }; // implies start() +}); diff --git a/testing/web-platform/tests/webmessaging/message-channels/no-start.any.js b/testing/web-platform/tests/webmessaging/message-channels/no-start.any.js new file mode 100644 index 0000000000..75b1ea1b26 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/message-channels/no-start.any.js @@ -0,0 +1,9 @@ +// META: title=without start() + +async_test(function(t) { + var channel = new MessageChannel(); + channel.port1.postMessage(1); + var i = 0; + channel.port2.addEventListener('message', function() { i++; }, false); + setTimeout(t.step_func(function() { assert_equals(i, 0); t.done();}), 50); +}); diff --git a/testing/web-platform/tests/webmessaging/message-channels/resources/cross-document-1.html b/testing/web-platform/tests/webmessaging/message-channels/resources/cross-document-1.html new file mode 100644 index 0000000000..93725a93f8 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/message-channels/resources/cross-document-1.html @@ -0,0 +1,8 @@ + +crosss-document-1 + \ No newline at end of file diff --git a/testing/web-platform/tests/webmessaging/message-channels/resources/cross-document-2.html b/testing/web-platform/tests/webmessaging/message-channels/resources/cross-document-2.html new file mode 100644 index 0000000000..1b8ef0a7a0 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/message-channels/resources/cross-document-2.html @@ -0,0 +1,10 @@ + +004-2 + \ No newline at end of file diff --git a/testing/web-platform/tests/webmessaging/message-channels/user-activation.tentative.any.js b/testing/web-platform/tests/webmessaging/message-channels/user-activation.tentative.any.js new file mode 100644 index 0000000000..175662873c --- /dev/null +++ b/testing/web-platform/tests/webmessaging/message-channels/user-activation.tentative.any.js @@ -0,0 +1,21 @@ +// META: title=user activation messagechannel test + +async_test(function(t) { + var channel = new MessageChannel(); + channel.port1.postMessage(1, {includeUserActivation: true}); + channel.port1.postMessage(2); + var expected_data = 1; + channel.port2.onmessage = t.step_func( + function(e) { + assert_equals(e.data, expected_data); + expected_data++; + if (e.data == 1) { + assert_false(e.userActivation.isActive); + assert_false(e.userActivation.hasBeenActive); + } else { + assert_equals(e.userActivation, null); + t.done(); + } + }); + channel.port2.start(); +}); diff --git a/testing/web-platform/tests/webmessaging/message-channels/worker-post-after-close.any.js b/testing/web-platform/tests/webmessaging/message-channels/worker-post-after-close.any.js new file mode 100644 index 0000000000..2de0c434de --- /dev/null +++ b/testing/web-platform/tests/webmessaging/message-channels/worker-post-after-close.any.js @@ -0,0 +1,28 @@ +async_test(t => { + function workerCode() { + onmessage = function(e) { + close(); + var mc = new MessageChannel(); + mc.port1.onmessage = function() { + postMessage("message received!"); + } + mc.port2.postMessage(42); + postMessage("done"); + } + } + + var workerBlob = new Blob([workerCode.toString() + ";workerCode();"], {type:"application/javascript"}); + + var w = new Worker(URL.createObjectURL(workerBlob)); + w.postMessage(''); + w.onmessage = function(e) { + if (e.data == "done") { + setTimeout(function() { + t.done(); + }, 250); + } else { + assert_true(false, "A wrong message has been received!"); + } + } +}, 'MessageChannel/MessagePort should not work after a worker self.close()'); + diff --git a/testing/web-platform/tests/webmessaging/message-channels/worker.any.js b/testing/web-platform/tests/webmessaging/message-channels/worker.any.js new file mode 100644 index 0000000000..633d89a371 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/message-channels/worker.any.js @@ -0,0 +1,17 @@ +async_test(t => { + function workerCode() { + close(); + var mc = new MessageChannel(); + mc.port1.postMessage(42); + mc.port2.postMessage(42); + postMessage(true); + } + + var workerBlob = new Blob([workerCode.toString() + ";workerCode();"], {type:"application/javascript"}); + + var w = new Worker(URL.createObjectURL(workerBlob)); + w.onmessage = function(e) { + assert_true(e.data, "MessageChannel created on worker shutdown."); + t.done(); + } +}, 'MessageChannel/MessagePort created and used after a worker self.close()'); diff --git a/testing/web-platform/tests/webmessaging/messageerror.html b/testing/web-platform/tests/webmessaging/messageerror.html new file mode 100644 index 0000000000..2cb51ee3c0 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/messageerror.html @@ -0,0 +1,44 @@ + +onmessageerror content attribute + + + + + + + + diff --git a/testing/web-platform/tests/webmessaging/multi-globals/broadcastchannel-current.sub.html b/testing/web-platform/tests/webmessaging/multi-globals/broadcastchannel-current.sub.html new file mode 100644 index 0000000000..ae2369394e --- /dev/null +++ b/testing/web-platform/tests/webmessaging/multi-globals/broadcastchannel-current.sub.html @@ -0,0 +1,45 @@ + + +The current page being cross-origin must prevent the BroadcastChannel message from being seen + + + + + + + + + diff --git a/testing/web-platform/tests/webmessaging/multi-globals/broadcastchannel-incumbent.sub.html b/testing/web-platform/tests/webmessaging/multi-globals/broadcastchannel-incumbent.sub.html new file mode 100644 index 0000000000..31a4221c1d --- /dev/null +++ b/testing/web-platform/tests/webmessaging/multi-globals/broadcastchannel-incumbent.sub.html @@ -0,0 +1,34 @@ + + +The incumbent page being cross-origin must not prevent the BroadcastChannel message from being seen + + + + + + + + + diff --git a/testing/web-platform/tests/webmessaging/multi-globals/messageport-current.html b/testing/web-platform/tests/webmessaging/multi-globals/messageport-current.html new file mode 100644 index 0000000000..ee172c6138 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/multi-globals/messageport-current.html @@ -0,0 +1,39 @@ + + +Making the current page become non-active must prevent message transmission + + + + + + + + + diff --git a/testing/web-platform/tests/webmessaging/multi-globals/messageport-incumbent.html b/testing/web-platform/tests/webmessaging/multi-globals/messageport-incumbent.html new file mode 100644 index 0000000000..4d47fb8124 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/multi-globals/messageport-incumbent.html @@ -0,0 +1,35 @@ + + +Making the incumbent page become non-active must not prevent message transmission + + + + + + + + + diff --git a/testing/web-platform/tests/webmessaging/multi-globals/support/current-document-domain.sub.html b/testing/web-platform/tests/webmessaging/multi-globals/support/current-document-domain.sub.html new file mode 100644 index 0000000000..1b15f72ca4 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/multi-globals/support/current-document-domain.sub.html @@ -0,0 +1,10 @@ + + +Current page used as a test helper + +

Current

+ + diff --git a/testing/web-platform/tests/webmessaging/multi-globals/support/current.html b/testing/web-platform/tests/webmessaging/multi-globals/support/current.html new file mode 100644 index 0000000000..d05709dd43 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/multi-globals/support/current.html @@ -0,0 +1,5 @@ + + +Current page used as a test helper + +

Current

diff --git a/testing/web-platform/tests/webmessaging/multi-globals/support/incumbent-document-domain.sub.html b/testing/web-platform/tests/webmessaging/multi-globals/support/incumbent-document-domain.sub.html new file mode 100644 index 0000000000..4791c29be7 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/multi-globals/support/incumbent-document-domain.sub.html @@ -0,0 +1,14 @@ + + +Incumbent page used as a test helper + +

Incumbent

+ + diff --git a/testing/web-platform/tests/webmessaging/multi-globals/support/incumbent.html b/testing/web-platform/tests/webmessaging/multi-globals/support/incumbent.html new file mode 100644 index 0000000000..a06e93c7ab --- /dev/null +++ b/testing/web-platform/tests/webmessaging/multi-globals/support/incumbent.html @@ -0,0 +1,13 @@ + + +Incumbent page used as a test helper + +

Incumbent

+ + diff --git a/testing/web-platform/tests/webmessaging/postMessage_ArrayBuffer.sub.htm b/testing/web-platform/tests/webmessaging/postMessage_ArrayBuffer.sub.htm new file mode 100644 index 0000000000..457cf94fa5 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_ArrayBuffer.sub.htm @@ -0,0 +1,44 @@ + + + + postMessage with ArrayBuffer object + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/postMessage_CryptoKey_insecure.sub.html b/testing/web-platform/tests/webmessaging/postMessage_CryptoKey_insecure.sub.html new file mode 100644 index 0000000000..8e5bdcb9c6 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_CryptoKey_insecure.sub.html @@ -0,0 +1,20 @@ + + + + + + diff --git a/testing/web-platform/tests/webmessaging/postMessage_Date.sub.htm b/testing/web-platform/tests/webmessaging/postMessage_Date.sub.htm new file mode 100644 index 0000000000..0f89738f3a --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_Date.sub.htm @@ -0,0 +1,40 @@ + + + + postMessage with Date object + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/postMessage_Document.htm b/testing/web-platform/tests/webmessaging/postMessage_Document.htm new file mode 100644 index 0000000000..c00a09a865 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_Document.htm @@ -0,0 +1,36 @@ + + + + postMessage with Document object + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/postMessage_Function.htm b/testing/web-platform/tests/webmessaging/postMessage_Function.htm new file mode 100644 index 0000000000..3976cebb74 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_Function.htm @@ -0,0 +1,36 @@ + + + + postMessage with Function object + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/postMessage_MessagePorts_sorigin.htm b/testing/web-platform/tests/webmessaging/postMessage_MessagePorts_sorigin.htm new file mode 100644 index 0000000000..6526e972c4 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_MessagePorts_sorigin.htm @@ -0,0 +1,76 @@ + + + + postMessage to same-origin iframe with MessagePort array [100 ports] + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/postMessage_MessagePorts_xorigin.sub.htm b/testing/web-platform/tests/webmessaging/postMessage_MessagePorts_xorigin.sub.htm new file mode 100644 index 0000000000..cf2b8eb4c1 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_MessagePorts_xorigin.sub.htm @@ -0,0 +1,76 @@ + + + + postMessage to cross-origin iframe with MessagePort array [100 ports] + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/postMessage_MessagePorts_xsite.sub.window.js b/testing/web-platform/tests/webmessaging/postMessage_MessagePorts_xsite.sub.window.js new file mode 100644 index 0000000000..ca1e510eda --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_MessagePorts_xsite.sub.window.js @@ -0,0 +1,66 @@ +// META: script=/common/get-host-info.sub.js + +async_test(function(t) { + var host = get_host_info(); + var noteSameSiteURL = host.HTTP_NOTSAMESITE_ORIGIN + "/webmessaging/support/ChildWindowPostMessage.htm"; + var TOTALPORTS = 100; + var LocalPorts = []; + var RemotePorts = []; + var PassedResult = 0; + var sum = 0; + let iframe = document.createElement('iframe'); + iframe.src = noteSameSiteURL; + document.body.appendChild(iframe); + var TARGET = document.querySelector("iframe").contentWindow; + iframe.onload = t.step_func(function() { + assert_own_property(window, "MessageChannel", "window"); + + var channels = []; + + for (var i=0; i + + + postMessage with arrays + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/postMessage_asterisk_xorigin.sub.htm b/testing/web-platform/tests/webmessaging/postMessage_asterisk_xorigin.sub.htm new file mode 100644 index 0000000000..2fab9431ef --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_asterisk_xorigin.sub.htm @@ -0,0 +1,52 @@ + + + + Cross-origin postMessage with targetOrigin == "*" + + + + +
+ + + +
+ + +
+ + diff --git a/testing/web-platform/tests/webmessaging/postMessage_cross_domain_image_transfer_2d.sub.htm b/testing/web-platform/tests/webmessaging/postMessage_cross_domain_image_transfer_2d.sub.htm new file mode 100644 index 0000000000..4faf979274 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_cross_domain_image_transfer_2d.sub.htm @@ -0,0 +1,34 @@ + + + + + + + diff --git a/testing/web-platform/tests/webmessaging/postMessage_crosssite.sub.htm b/testing/web-platform/tests/webmessaging/postMessage_crosssite.sub.htm new file mode 100644 index 0000000000..25bccd9df2 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_crosssite.sub.htm @@ -0,0 +1,29 @@ + + + + + + diff --git a/testing/web-platform/tests/webmessaging/postMessage_dup_transfer_objects.htm b/testing/web-platform/tests/webmessaging/postMessage_dup_transfer_objects.htm new file mode 100644 index 0000000000..ade9515d3a --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_dup_transfer_objects.htm @@ -0,0 +1,38 @@ + + + + postMessage with duplicate transfer objects raises DataCloneError exception + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/postMessage_invalid_targetOrigin.htm b/testing/web-platform/tests/webmessaging/postMessage_invalid_targetOrigin.htm new file mode 100644 index 0000000000..e2b39df22d --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_invalid_targetOrigin.htm @@ -0,0 +1,38 @@ + + + + postMessage with invalid targetOrigin raises SyntaxError exception + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/postMessage_objects.sub.htm b/testing/web-platform/tests/webmessaging/postMessage_objects.sub.htm new file mode 100644 index 0000000000..dab207188a --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_objects.sub.htm @@ -0,0 +1,40 @@ + + + + postMessage with nested objects + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/postMessage_origin_mismatch.sub.htm b/testing/web-platform/tests/webmessaging/postMessage_origin_mismatch.sub.htm new file mode 100644 index 0000000000..6c8ac8353a --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_origin_mismatch.sub.htm @@ -0,0 +1,51 @@ + + + + Same-origin: Origin of the target window doesn't match the given origin + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/postMessage_origin_mismatch_xorigin.sub.htm b/testing/web-platform/tests/webmessaging/postMessage_origin_mismatch_xorigin.sub.htm new file mode 100644 index 0000000000..d8e38e2919 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_origin_mismatch_xorigin.sub.htm @@ -0,0 +1,51 @@ + + + + Cross-origin: Origin of the target window doesn't match the given origin + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/postMessage_solidus_sorigin.htm b/testing/web-platform/tests/webmessaging/postMessage_solidus_sorigin.htm new file mode 100644 index 0000000000..92f5afb798 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_solidus_sorigin.htm @@ -0,0 +1,43 @@ + + + + Same-origin postMessage with targetOrigin == "/" + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/postMessage_solidus_xorigin.sub.htm b/testing/web-platform/tests/webmessaging/postMessage_solidus_xorigin.sub.htm new file mode 100644 index 0000000000..eebc85432f --- /dev/null +++ b/testing/web-platform/tests/webmessaging/postMessage_solidus_xorigin.sub.htm @@ -0,0 +1,48 @@ + + + + Cross-origin postMessage with targetOrigin == "/" + + + + +
+ +
+ +
+ + + + diff --git a/testing/web-platform/tests/webmessaging/resources/post-cryptokey-to-opener.html b/testing/web-platform/tests/webmessaging/resources/post-cryptokey-to-opener.html new file mode 100644 index 0000000000..91c70165f0 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/resources/post-cryptokey-to-opener.html @@ -0,0 +1,6 @@ + + diff --git a/testing/web-platform/tests/webmessaging/resources/transfer-arraybuffer-to-parent.html b/testing/web-platform/tests/webmessaging/resources/transfer-arraybuffer-to-parent.html new file mode 100644 index 0000000000..97cff4dcb3 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/resources/transfer-arraybuffer-to-parent.html @@ -0,0 +1,5 @@ + + diff --git a/testing/web-platform/tests/webmessaging/support/ChildWindowPostMessage.htm b/testing/web-platform/tests/webmessaging/support/ChildWindowPostMessage.htm new file mode 100644 index 0000000000..13d4103a82 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/support/ChildWindowPostMessage.htm @@ -0,0 +1,58 @@ + + + + Child window for Web Messaging tests + + + + + diff --git a/testing/web-platform/tests/webmessaging/support/MessageEvent-trusted-worker.js b/testing/web-platform/tests/webmessaging/support/MessageEvent-trusted-worker.js new file mode 100644 index 0000000000..6e8c3a781b --- /dev/null +++ b/testing/web-platform/tests/webmessaging/support/MessageEvent-trusted-worker.js @@ -0,0 +1,4 @@ +"use strict"; + +const channel = new BroadcastChannel("channel name"); +channel.postMessage("ping"); diff --git a/testing/web-platform/tests/webmessaging/support/compare.js b/testing/web-platform/tests/webmessaging/support/compare.js new file mode 100644 index 0000000000..5341b37438 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/support/compare.js @@ -0,0 +1,39 @@ +function sameDate(d1, d2) { + return (d1 instanceof Date && d2 instanceof Date && d1.valueOf() == d2.valueOf()); +} + +function sameRE(r1, r2) { + return (r1 instanceof RegExp && r2 instanceof RegExp && r1.toString() == r2.toString()); +} + +function assert_array_equals_(observed, expected, msg) { + if (observed.length == expected.length) { + for (var i = 0; i < observed.length; i++) { + if (observed[i] instanceof Date) { + observed[i] = sameDate(observed[i], expected[i]); + expected[i] = true; + } else if (observed[i] instanceof RegExp) { + observed[i] = sameRE(observed[i], expected[i]); + expected[i] = true; + } + } + } + + assert_array_equals(observed, expected, msg); +} + +function assert_object_equals_(observed, expected, msg) { + for (var p in observed) { + if (observed[p] instanceof Date) { + observed[p] = sameDate(observed[p], expected[p]); + expected[p] = true; + } else if (observed[p] instanceof RegExp) { + observed[p] = sameRE(observed[p], expected[p]); + expected[p] = true; + } else if (observed[p] instanceof Array || String(observed[p]) === '[object Object]') { + observed[p] = String(observed[p]) === String(expected[p]); + expected[p] = true; + } + assert_equals(observed[p], expected[p], msg); + } +} diff --git a/testing/web-platform/tests/webmessaging/support/cross-domain-image-receive.htm b/testing/web-platform/tests/webmessaging/support/cross-domain-image-receive.htm new file mode 100644 index 0000000000..253b34bd76 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/support/cross-domain-image-receive.htm @@ -0,0 +1,25 @@ + + + + + Cross-Domain image transfer test + + + + + diff --git a/testing/web-platform/tests/webmessaging/with-options/broken-origin.html b/testing/web-platform/tests/webmessaging/with-options/broken-origin.html new file mode 100644 index 0000000000..795404b0ec --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-options/broken-origin.html @@ -0,0 +1,12 @@ + +resolving broken url + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-options/host-specific-origin.html b/testing/web-platform/tests/webmessaging/with-options/host-specific-origin.html new file mode 100644 index 0000000000..5003bcc807 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-options/host-specific-origin.html @@ -0,0 +1,14 @@ + +resolving url with stuff in host-specific + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-options/message-channel-transferable.html b/testing/web-platform/tests/webmessaging/with-options/message-channel-transferable.html new file mode 100644 index 0000000000..d42db10695 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-options/message-channel-transferable.html @@ -0,0 +1,15 @@ + +message channel as ports + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-options/no-target-origin.html b/testing/web-platform/tests/webmessaging/with-options/no-target-origin.html new file mode 100644 index 0000000000..517466cc4c --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-options/no-target-origin.html @@ -0,0 +1,14 @@ + +no targetOrigin + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-options/null-transfer.html b/testing/web-platform/tests/webmessaging/with-options/null-transfer.html new file mode 100644 index 0000000000..2ea09eb7ab --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-options/null-transfer.html @@ -0,0 +1,10 @@ + +null transfer + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-options/one-arg.html b/testing/web-platform/tests/webmessaging/with-options/one-arg.html new file mode 100644 index 0000000000..8246e55f31 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-options/one-arg.html @@ -0,0 +1,13 @@ + +just one argument + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-options/slash-origin.html b/testing/web-platform/tests/webmessaging/with-options/slash-origin.html new file mode 100644 index 0000000000..8bfde73774 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-options/slash-origin.html @@ -0,0 +1,14 @@ + +special value '/' + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-options/undefined-transferable.html b/testing/web-platform/tests/webmessaging/with-options/undefined-transferable.html new file mode 100644 index 0000000000..a123b7d9bd --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-options/undefined-transferable.html @@ -0,0 +1,14 @@ + +undefined as transferable + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-options/unknown-parameter.html b/testing/web-platform/tests/webmessaging/with-options/unknown-parameter.html new file mode 100644 index 0000000000..de050e74f5 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-options/unknown-parameter.html @@ -0,0 +1,14 @@ + +unknown parameter + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-ports/001.html b/testing/web-platform/tests/webmessaging/with-ports/001.html new file mode 100644 index 0000000000..62dcf5e9bf --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/001.html @@ -0,0 +1,12 @@ + +resolving broken url + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-ports/002.html b/testing/web-platform/tests/webmessaging/with-ports/002.html new file mode 100644 index 0000000000..f7d085937c --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/002.html @@ -0,0 +1,14 @@ + +resolving url with stuff in host-specific + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-ports/003.html b/testing/web-platform/tests/webmessaging/with-ports/003.html new file mode 100644 index 0000000000..47ddfbe81a --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/003.html @@ -0,0 +1,12 @@ + +resolving 'example.org' + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-ports/004.html b/testing/web-platform/tests/webmessaging/with-ports/004.html new file mode 100644 index 0000000000..d129ad119a --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/004.html @@ -0,0 +1,14 @@ + +special value '/' + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-ports/005.html b/testing/web-platform/tests/webmessaging/with-ports/005.html new file mode 100644 index 0000000000..e803968919 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/005.html @@ -0,0 +1,14 @@ + +resolving a same origin targetOrigin + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-ports/006.html b/testing/web-platform/tests/webmessaging/with-ports/006.html new file mode 100644 index 0000000000..4e3f1ede84 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/006.html @@ -0,0 +1,14 @@ + +resolving a same origin targetOrigin with trailing slash + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-ports/007.html b/testing/web-platform/tests/webmessaging/with-ports/007.html new file mode 100644 index 0000000000..c049a1337d --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/007.html @@ -0,0 +1,14 @@ + +targetOrigin '*' + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-ports/010.html b/testing/web-platform/tests/webmessaging/with-ports/010.html new file mode 100644 index 0000000000..05080e3f7a --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/010.html @@ -0,0 +1,113 @@ + +message clone + + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-ports/011.html b/testing/web-platform/tests/webmessaging/with-ports/011.html new file mode 100644 index 0000000000..782b3208ba --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/011.html @@ -0,0 +1,29 @@ + +posting an imagedata (from a cloned canvas) in an array + + +
+ + diff --git a/testing/web-platform/tests/webmessaging/with-ports/012.html b/testing/web-platform/tests/webmessaging/with-ports/012.html new file mode 100644 index 0000000000..6efe4c114a --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/012.html @@ -0,0 +1,16 @@ + +loop in array in structured clone + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-ports/013.html b/testing/web-platform/tests/webmessaging/with-ports/013.html new file mode 100644 index 0000000000..248958ea10 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/013.html @@ -0,0 +1,17 @@ + +loop in object in structured clone + + +
+ + diff --git a/testing/web-platform/tests/webmessaging/with-ports/014.html b/testing/web-platform/tests/webmessaging/with-ports/014.html new file mode 100644 index 0000000000..3c970c42ad --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/014.html @@ -0,0 +1,17 @@ + +structured clone vs reference + + +
+ diff --git a/testing/web-platform/tests/webmessaging/with-ports/015.html b/testing/web-platform/tests/webmessaging/with-ports/015.html new file mode 100644 index 0000000000..a17c97be19 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/015.html @@ -0,0 +1,15 @@ + +different origin + + +
+ + diff --git a/testing/web-platform/tests/webmessaging/with-ports/016.html b/testing/web-platform/tests/webmessaging/with-ports/016.html new file mode 100644 index 0000000000..51cadec7c1 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/016.html @@ -0,0 +1,23 @@ + +origin of the script that invoked the method, data: + + + +
+ + + diff --git a/testing/web-platform/tests/webmessaging/with-ports/017.html b/testing/web-platform/tests/webmessaging/with-ports/017.html new file mode 100644 index 0000000000..94cd3e6ae2 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/017.html @@ -0,0 +1,18 @@ + +origin of the script that invoked the method, about:blank + + + +
+ + + diff --git a/testing/web-platform/tests/webmessaging/with-ports/018.html b/testing/web-platform/tests/webmessaging/with-ports/018.html new file mode 100644 index 0000000000..5525206e44 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/018.html @@ -0,0 +1,18 @@ + +origin of the script that invoked the method, javascript: + + + +
+ + + diff --git a/testing/web-platform/tests/webmessaging/with-ports/019.html b/testing/web-platform/tests/webmessaging/with-ports/019.html new file mode 100644 index 0000000000..e9de6c36e1 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/019.html @@ -0,0 +1,20 @@ + +origin of the script that invoked the method, scheme/host/port + + + +
+ + + diff --git a/testing/web-platform/tests/webmessaging/with-ports/020.html b/testing/web-platform/tests/webmessaging/with-ports/020.html new file mode 100644 index 0000000000..426a3d2700 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/020.html @@ -0,0 +1,32 @@ + +cross-origin test + + + +
+ +
+ + diff --git a/testing/web-platform/tests/webmessaging/with-ports/021.html b/testing/web-platform/tests/webmessaging/with-ports/021.html new file mode 100644 index 0000000000..2801d45a44 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/021.html @@ -0,0 +1,32 @@ + +cross-origin test + + + +
+ +
+ + diff --git a/testing/web-platform/tests/webmessaging/with-ports/023.html b/testing/web-platform/tests/webmessaging/with-ports/023.html new file mode 100644 index 0000000000..e2569a8463 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/023.html @@ -0,0 +1,11 @@ + +null ports + + +
+ + diff --git a/testing/web-platform/tests/webmessaging/with-ports/024.html b/testing/web-platform/tests/webmessaging/with-ports/024.html new file mode 100644 index 0000000000..e6c0dcba08 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/024.html @@ -0,0 +1,15 @@ + +undefined as ports + + +
+ + diff --git a/testing/web-platform/tests/webmessaging/with-ports/025.html b/testing/web-platform/tests/webmessaging/with-ports/025.html new file mode 100644 index 0000000000..7af2a852ed --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/025.html @@ -0,0 +1,13 @@ + +1 as ports + + +
+ + diff --git a/testing/web-platform/tests/webmessaging/with-ports/026.html b/testing/web-platform/tests/webmessaging/with-ports/026.html new file mode 100644 index 0000000000..2af90e6be3 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/026.html @@ -0,0 +1,13 @@ + +object with length as transferable + + +
+ + diff --git a/testing/web-platform/tests/webmessaging/with-ports/027.html b/testing/web-platform/tests/webmessaging/with-ports/027.html new file mode 100644 index 0000000000..7158351258 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/with-ports/027.html @@ -0,0 +1,26 @@ + +message channel as ports + + +
+ + diff --git a/testing/web-platform/tests/webmessaging/without-ports/001.html b/testing/web-platform/tests/webmessaging/without-ports/001.html new file mode 100644 index 0000000000..09c28c5a5c --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/001.html @@ -0,0 +1,12 @@ + +resolving broken url + + +
+ diff --git a/testing/web-platform/tests/webmessaging/without-ports/002.html b/testing/web-platform/tests/webmessaging/without-ports/002.html new file mode 100644 index 0000000000..ef3eceb2a0 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/002.html @@ -0,0 +1,14 @@ + +resolving url with stuff in host-specific + + +
+ diff --git a/testing/web-platform/tests/webmessaging/without-ports/003.html b/testing/web-platform/tests/webmessaging/without-ports/003.html new file mode 100644 index 0000000000..6dc1e55777 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/003.html @@ -0,0 +1,12 @@ + +resolving 'example.org' + + +
+ diff --git a/testing/web-platform/tests/webmessaging/without-ports/004.html b/testing/web-platform/tests/webmessaging/without-ports/004.html new file mode 100644 index 0000000000..9a9eb81a5d --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/004.html @@ -0,0 +1,14 @@ + +special value '/' + + +
+ diff --git a/testing/web-platform/tests/webmessaging/without-ports/005.html b/testing/web-platform/tests/webmessaging/without-ports/005.html new file mode 100644 index 0000000000..ed05a476bc --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/005.html @@ -0,0 +1,14 @@ + +resolving a same origin targetOrigin + + +
+ diff --git a/testing/web-platform/tests/webmessaging/without-ports/006.html b/testing/web-platform/tests/webmessaging/without-ports/006.html new file mode 100644 index 0000000000..47479ea011 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/006.html @@ -0,0 +1,14 @@ + +resolving a same origin targetOrigin with trailing slash + + +
+ diff --git a/testing/web-platform/tests/webmessaging/without-ports/007.html b/testing/web-platform/tests/webmessaging/without-ports/007.html new file mode 100644 index 0000000000..eb2b5c52e5 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/007.html @@ -0,0 +1,14 @@ + +targetOrigin '*' + + +
+ diff --git a/testing/web-platform/tests/webmessaging/without-ports/009.html b/testing/web-platform/tests/webmessaging/without-ports/009.html new file mode 100644 index 0000000000..d613b4a073 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/009.html @@ -0,0 +1,12 @@ + +zero arguments + + +
+ diff --git a/testing/web-platform/tests/webmessaging/without-ports/010.html b/testing/web-platform/tests/webmessaging/without-ports/010.html new file mode 100644 index 0000000000..062316f680 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/010.html @@ -0,0 +1,112 @@ + +message clone + + + +
+ diff --git a/testing/web-platform/tests/webmessaging/without-ports/011.html b/testing/web-platform/tests/webmessaging/without-ports/011.html new file mode 100644 index 0000000000..cac2990c49 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/011.html @@ -0,0 +1,29 @@ + +posting an imagedata (from a cloned canvas) in an array + + +
+ + diff --git a/testing/web-platform/tests/webmessaging/without-ports/012.html b/testing/web-platform/tests/webmessaging/without-ports/012.html new file mode 100644 index 0000000000..8eb46539b7 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/012.html @@ -0,0 +1,16 @@ + +loop in array in structured clone + + +
+ diff --git a/testing/web-platform/tests/webmessaging/without-ports/013.html b/testing/web-platform/tests/webmessaging/without-ports/013.html new file mode 100644 index 0000000000..34ba76221a --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/013.html @@ -0,0 +1,17 @@ + +loop in object in structured clone + + +
+ + diff --git a/testing/web-platform/tests/webmessaging/without-ports/014.html b/testing/web-platform/tests/webmessaging/without-ports/014.html new file mode 100644 index 0000000000..f200aa4673 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/014.html @@ -0,0 +1,17 @@ + +structured clone vs reference + + +
+ diff --git a/testing/web-platform/tests/webmessaging/without-ports/015.html b/testing/web-platform/tests/webmessaging/without-ports/015.html new file mode 100644 index 0000000000..a17c97be19 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/015.html @@ -0,0 +1,15 @@ + +different origin + + +
+ + diff --git a/testing/web-platform/tests/webmessaging/without-ports/016.html b/testing/web-platform/tests/webmessaging/without-ports/016.html new file mode 100644 index 0000000000..51cadec7c1 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/016.html @@ -0,0 +1,23 @@ + +origin of the script that invoked the method, data: + + + +
+ + + diff --git a/testing/web-platform/tests/webmessaging/without-ports/017.html b/testing/web-platform/tests/webmessaging/without-ports/017.html new file mode 100644 index 0000000000..a4a0483624 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/017.html @@ -0,0 +1,18 @@ + +origin of the script that invoked the method, about:blank + + + +
+ + + diff --git a/testing/web-platform/tests/webmessaging/without-ports/018.html b/testing/web-platform/tests/webmessaging/without-ports/018.html new file mode 100644 index 0000000000..207ae36ed8 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/018.html @@ -0,0 +1,17 @@ + +origin of the script that invoked the method, javascript: + + + +
+ + + diff --git a/testing/web-platform/tests/webmessaging/without-ports/019-1.html b/testing/web-platform/tests/webmessaging/without-ports/019-1.html new file mode 100644 index 0000000000..513123ee6d --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/019-1.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/webmessaging/without-ports/019.html b/testing/web-platform/tests/webmessaging/without-ports/019.html new file mode 100644 index 0000000000..38e7ca230e --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/019.html @@ -0,0 +1,20 @@ + +origin of the script that invoked the method, scheme/host/port + + + +
+ + + diff --git a/testing/web-platform/tests/webmessaging/without-ports/020-1.html b/testing/web-platform/tests/webmessaging/without-ports/020-1.html new file mode 100644 index 0000000000..225bd7a41e --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/020-1.html @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/webmessaging/without-ports/020.html b/testing/web-platform/tests/webmessaging/without-ports/020.html new file mode 100644 index 0000000000..61bfddb901 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/020.html @@ -0,0 +1,32 @@ + +cross-origin test + + + +
+ +
+ + diff --git a/testing/web-platform/tests/webmessaging/without-ports/021.html b/testing/web-platform/tests/webmessaging/without-ports/021.html new file mode 100644 index 0000000000..5072508d9c --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/021.html @@ -0,0 +1,32 @@ + +cross-origin test + + + +
+ +
+ + diff --git a/testing/web-platform/tests/webmessaging/without-ports/023.html b/testing/web-platform/tests/webmessaging/without-ports/023.html new file mode 100644 index 0000000000..1e12ac4a55 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/023.html @@ -0,0 +1,29 @@ + +Object cloning: own properties only, don't follow prototype + + +
+ diff --git a/testing/web-platform/tests/webmessaging/without-ports/024.html b/testing/web-platform/tests/webmessaging/without-ports/024.html new file mode 100644 index 0000000000..0e4651593a --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/024.html @@ -0,0 +1,14 @@ + +Object cloning: throw an exception if function values encountered + + +
+ diff --git a/testing/web-platform/tests/webmessaging/without-ports/025-1.js b/testing/web-platform/tests/webmessaging/without-ports/025-1.js new file mode 100644 index 0000000000..bd1d778d9b --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/025-1.js @@ -0,0 +1,15 @@ +importScripts("/resources/testharness.js"); + +test(function() { + var ch = new MessageChannel(); + assert_true(ch.port1 instanceof MessagePort, + "Worker MessageChannel's port not an instance of MessagePort"); +}, "Worker MessageChannel's port should be an instance of MessagePort"); + +test(function() { + assert_throws_js(TypeError, function() { + new MessagePort() + }, "MessagePort is [[Callable]]"); +}, "Worker MessagePort should not be [[Callable]]"); + +done(); diff --git a/testing/web-platform/tests/webmessaging/without-ports/025.html b/testing/web-platform/tests/webmessaging/without-ports/025.html new file mode 100644 index 0000000000..4686febe94 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/025.html @@ -0,0 +1,13 @@ + +MessagePort constructor properties + + +
+ diff --git a/testing/web-platform/tests/webmessaging/without-ports/026.html b/testing/web-platform/tests/webmessaging/without-ports/026.html new file mode 100644 index 0000000000..546da8a91b --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/026.html @@ -0,0 +1,17 @@ + +Cloning objects with getter properties + + +
+ diff --git a/testing/web-platform/tests/webmessaging/without-ports/027.html b/testing/web-platform/tests/webmessaging/without-ports/027.html new file mode 100644 index 0000000000..36aa9446a5 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/027.html @@ -0,0 +1,19 @@ + +Cloning objects, preserving sharing + + +
+ diff --git a/testing/web-platform/tests/webmessaging/without-ports/028.html b/testing/web-platform/tests/webmessaging/without-ports/028.html new file mode 100644 index 0000000000..d51ad7d3b6 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/028.html @@ -0,0 +1,19 @@ + +Cloning objects, preserving sharing #2 + + + +
+ diff --git a/testing/web-platform/tests/webmessaging/without-ports/029.html b/testing/web-platform/tests/webmessaging/without-ports/029.html new file mode 100644 index 0000000000..4b1b38f741 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/without-ports/029.html @@ -0,0 +1,20 @@ + +Check that getters don't linger after deletion wrt cloning + + +
+ diff --git a/testing/web-platform/tests/webmessaging/worker_postMessage_user_activation.js b/testing/web-platform/tests/webmessaging/worker_postMessage_user_activation.js new file mode 100644 index 0000000000..e4c7eec2b7 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/worker_postMessage_user_activation.js @@ -0,0 +1,3 @@ +"use strict"; + +onmessage = e => postMessage(e.userActivation !== null); diff --git a/testing/web-platform/tests/webmessaging/worker_postMessage_user_activation.tentative.html b/testing/web-platform/tests/webmessaging/worker_postMessage_user_activation.tentative.html new file mode 100644 index 0000000000..203bb14985 --- /dev/null +++ b/testing/web-platform/tests/webmessaging/worker_postMessage_user_activation.tentative.html @@ -0,0 +1,19 @@ + +postMessage with user activtion to a worker + + + + -- cgit v1.2.3