From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- testing/web-platform/tests/workers/OWNERS | 6 + testing/web-platform/tests/workers/README.md | 8 + .../workers/WorkerGlobalScope_ErrorEvent_colno.htm | 18 + .../WorkerGlobalScope_ErrorEvent_filename.htm | 20 + .../WorkerGlobalScope_ErrorEvent_lineno.htm | 18 + .../WorkerGlobalScope_ErrorEvent_message.htm | 19 + .../tests/workers/WorkerGlobalScope_close.htm | 17 + .../workers/WorkerGlobalScope_importScripts.htm | 14 + .../WorkerGlobalScope_importScripts_NetworkErr.htm | 13 + .../workers/WorkerGlobalScope_setInterval.htm | 20 + .../tests/workers/WorkerGlobalScope_setTimeout.htm | 20 + .../web-platform/tests/workers/WorkerLocation.htm | 15 + .../tests/workers/WorkerLocation_hash.htm | 13 + .../tests/workers/WorkerLocation_hash_encoding.htm | 13 + .../tests/workers/WorkerLocation_hash_nonexist.htm | 13 + .../tests/workers/WorkerLocation_host.htm | 13 + .../tests/workers/WorkerLocation_hostname.htm | 13 + .../tests/workers/WorkerLocation_href.htm | 15 + .../tests/workers/WorkerLocation_pathname.htm | 15 + .../tests/workers/WorkerLocation_port.htm | 13 + .../tests/workers/WorkerLocation_protocol.htm | 13 + .../tests/workers/WorkerLocation_search.htm | 13 + .../tests/workers/WorkerLocation_search_empty.htm | 13 + .../workers/WorkerLocation_search_fragment.htm | 13 + .../workers/WorkerLocation_search_nonexist.htm | 13 + .../tests/workers/WorkerNavigator_appName.htm | 13 + .../tests/workers/WorkerNavigator_appVersion.htm | 13 + .../tests/workers/WorkerNavigator_onLine.htm | 13 + .../tests/workers/WorkerNavigator_platform.htm | 13 + .../tests/workers/WorkerNavigator_userAgent.htm | 13 + .../Worker_ErrorEvent_bubbles_cancelable.htm | 22 + .../tests/workers/Worker_ErrorEvent_error.htm | 29 + .../tests/workers/Worker_ErrorEvent_filename.htm | 20 + .../tests/workers/Worker_ErrorEvent_lineno.htm | 18 + .../tests/workers/Worker_ErrorEvent_message.htm | 19 + .../tests/workers/Worker_ErrorEvent_type.htm | 19 + .../web-platform/tests/workers/Worker_basic.htm | 31 + .../workers/Worker_cross_origin_security_err.htm | 17 + .../workers/Worker_dispatchEvent_ErrorEvent.htm | 37 + .../tests/workers/Worker_script_mimetype.htm | 14 + .../tests/workers/Worker_terminate_event_queue.htm | 22 + .../tests/workers/baseurl/alpha/importScripts.html | 14 + .../tests/workers/baseurl/alpha/sharedworker.html | 14 + .../tests/workers/baseurl/alpha/worker.html | 14 + .../tests/workers/baseurl/alpha/xhr.html | 14 + .../tests/workers/baseurl/beta/importScripts.py | 3 + .../tests/workers/baseurl/beta/script.js | 1 + .../tests/workers/baseurl/beta/sharedworker.py | 3 + .../tests/workers/baseurl/beta/subsharedworker.js | 3 + .../tests/workers/baseurl/beta/subworker.js | 1 + .../tests/workers/baseurl/beta/test.txt | 1 + .../tests/workers/baseurl/beta/worker.py | 3 + .../web-platform/tests/workers/baseurl/beta/xhr.py | 3 + .../tests/workers/baseurl/gamma/importScripts.js | 1 + .../tests/workers/baseurl/gamma/script.js | 1 + .../tests/workers/baseurl/gamma/sharedworker.js | 4 + .../tests/workers/baseurl/gamma/subsharedworker.js | 3 + .../tests/workers/baseurl/gamma/subworker.js | 1 + .../tests/workers/baseurl/gamma/test.txt | 1 + .../tests/workers/baseurl/gamma/worker.js | 4 + .../tests/workers/baseurl/gamma/xhr.js | 4 + .../tests/workers/constructors/SharedWorker/1 | 3 + .../constructors/SharedWorker/URLMismatchError.htm | 19 + .../constructors/SharedWorker/connect-event.html | 26 + .../constructors/SharedWorker/dummy-name.html | 17 + .../SharedWorker/dummy-shared-worker.html | 17 + .../constructors/SharedWorker/empty-name.html | 17 + .../constructors/SharedWorker/global-members.html | 34 + .../SharedWorker/interface-objects.html | 41 + .../workers/constructors/SharedWorker/name.html | 24 + .../SharedWorker/no-arguments-ctor.html | 20 + .../tests/workers/constructors/SharedWorker/null | 3 + .../constructors/SharedWorker/null-arguments.html | 25 + .../SharedWorker/number-arguments.html | 25 + .../constructors/SharedWorker/port-onmessage.html | 23 + .../constructors/SharedWorker/port-properties.html | 26 + .../constructors/SharedWorker/port-readonly.html | 21 + .../constructors/SharedWorker/same-origin.html | 67 ++ .../SharedWorker/setting-port-members.html | 59 ++ .../constructors/SharedWorker/shared-worker.js | 6 + .../workers/constructors/SharedWorker/undefined | 3 + .../SharedWorker/undefined-arguments.html | 25 + .../SharedWorker/unexpected-global-properties.html | 30 + .../SharedWorker/unresolvable-url.html | 19 + .../tests/workers/constructors/Worker/1 | 1 + .../Worker/AbstractWorker.onerror.html | 48 + .../workers/constructors/Worker/Blob-url.html | 21 + .../DedicatedWorkerGlobalScope-members.worker.js | 18 + .../tests/workers/constructors/Worker/ctor-1.html | 23 + .../workers/constructors/Worker/ctor-null.html | 23 + .../constructors/Worker/ctor-undefined.html | 23 + .../Worker/expected-self-properties.worker.js | 11 + .../constructors/Worker/no-arguments-ctor.html | 13 + .../tests/workers/constructors/Worker/null | 1 + .../constructors/Worker/resolve-empty-string.html | 22 + .../workers/constructors/Worker/same-origin.html | 63 ++ .../constructors/Worker/sample_worker/worker.js | 1 + .../workers/constructors/Worker/terminate.html | 44 + .../tests/workers/constructors/Worker/undefined | 1 + .../Worker/unexpected-self-properties.worker.js | 11 + .../constructors/Worker/unresolvable-url.html | 12 + .../workers/constructors/Worker/use-base-url.html | 18 + testing/web-platform/tests/workers/interfaces.idl | 106 ++ .../tests/workers/interfaces.worker.js | 20 + .../EventTarget.worker.js | 23 + .../DedicatedWorkerGlobalScope/onmessage.worker.js | 40 + .../postMessage/event-ports-dedicated.html | 25 + .../imagedata-cloned-canvas-in-array.html | 39 + .../postMessage/message-event.html | 23 + .../postMessage/message-event.js | 1 + .../postMessage/return-value.worker.js | 8 + .../postMessage/second-argument-null-in-array.html | 26 + .../postMessage/second-argument-null.html | 25 + .../postMessage/second-argument-undefined.html | 25 + .../postMessage/setting-postMessage.html | 24 + .../postMessage/structured-clone-imagedata.html | 30 + .../postMessage/structured-clone-message.html | 58 ++ .../SharedWorkerGlobalScope/name/getting.html | 34 + .../SharedWorkerGlobalScope/name/setting.html | 25 + .../SharedWorkerGlobalScope/onconnect.html | 39 + .../WorkerGlobalScope/close/incoming-message.html | 29 + .../WorkerGlobalScope/close/sending-messages.html | 27 + .../WorkerGlobalScope/close/setInterval.html | 34 + .../WorkerGlobalScope/close/setTimeout.html | 28 + .../WorkerGlobalScope/location/helper-redirect.py | 3 + .../WorkerGlobalScope/location/members.html | 31 + .../location/post-location-members.js | 8 + .../WorkerGlobalScope/location/redirect.html | 28 + .../location/returns-same-object.html | 21 + .../location/setting-members.html | 43 + .../location/worker-separate-file.html | 28 + .../onerror/exception-in-onerror.html | 32 + .../WorkerGlobalScope/onerror/handled.html | 36 + .../WorkerGlobalScope/onerror/not-handled.html | 32 + .../onerror/propagate-to-window-onerror.html | 31 + .../workers/interfaces/WorkerGlobalScope/self.html | 39 + .../interfaces/WorkerUtils/WindowTimers/001.html | 23 + .../interfaces/WorkerUtils/WindowTimers/002.html | 21 + .../interfaces/WorkerUtils/WindowTimers/003.html | 22 + .../interfaces/WorkerUtils/WindowTimers/004.html | 23 + .../WorkerUtils/importScripts/001.worker.js | 7 + .../WorkerUtils/importScripts/002.worker.js | 11 + .../interfaces/WorkerUtils/importScripts/003.html | 28 + .../interfaces/WorkerUtils/importScripts/004.html | 34 + .../interfaces/WorkerUtils/importScripts/005.html | 30 + .../interfaces/WorkerUtils/importScripts/006.html | 33 + .../interfaces/WorkerUtils/importScripts/007.html | 25 + .../interfaces/WorkerUtils/importScripts/008.html | 23 + .../interfaces/WorkerUtils/importScripts/009.html | 29 + .../interfaces/WorkerUtils/importScripts/010.html | 34 + .../interfaces/WorkerUtils/importScripts/011.html | 34 + .../interfaces/WorkerUtils/importScripts/012.html | 34 + .../workers/interfaces/WorkerUtils/importScripts/1 | 1 + .../interfaces/WorkerUtils/importScripts/null | 1 + .../interfaces/WorkerUtils/importScripts/undefined | 1 + .../interfaces/WorkerUtils/navigator/002.html | 21 + .../interfaces/WorkerUtils/navigator/003.html | 21 + .../interfaces/WorkerUtils/navigator/004.html | 21 + .../interfaces/WorkerUtils/navigator/005.html | 21 + .../interfaces/WorkerUtils/navigator/006.html | 21 + .../interfaces/WorkerUtils/navigator/007.html | 30 + .../interfaces/WorkerUtils/navigator/language.html | 21 + .../WorkerUtils/navigator/window-only.worker.js | 22 + .../tests/workers/nested_worker.worker.js | 11 + .../non-automated/application-cache-dedicated.html | 21 + .../non-automated/application-cache-dedicated.js | 1 + .../tests/workers/non-automated/cache.manifest | 3 + .../workers/non-automated/infinite-nested.html | 12 + .../tests/workers/non-automated/infinite-nested.js | 5 + .../non-automated/infinite-sibling-and-nested.html | 12 + .../non-automated/infinite-sibling-and-nested.js | 8 + .../workers/non-automated/infinite-sibling.html | 12 + .../workers/non-automated/infinite-sibling.js | 8 + .../workers/non-automated/navigator-onLine.html | 46 + .../tests/workers/non-automated/post-a-1.js | 1 + .../tests/workers/postMessage_DataCloneErr.htm | 13 + .../tests/workers/postMessage_clone_port.htm | 22 + .../tests/workers/postMessage_clone_port_error.htm | 14 + .../tests/workers/postMessage_event_properties.htm | 24 + .../workers/postMessage_ports_readonly_array.htm | 20 + .../tests/workers/postMessage_target_source.htm | 18 + .../tests/workers/semantics/encodings/001.html | 21 + .../workers/semantics/encodings/001.html.headers | 1 + .../tests/workers/semantics/encodings/002.html | 23 + .../workers/semantics/encodings/002.html.headers | 1 + .../tests/workers/semantics/encodings/003-1.py | 4 + .../tests/workers/semantics/encodings/003.html | 26 + .../tests/workers/semantics/encodings/004.html | 27 + .../workers/semantics/encodings/004.worker.js | 5 + .../semantics/interface-objects/001.worker.js | 79 ++ .../semantics/interface-objects/002.worker.js | 49 + .../workers/semantics/interface-objects/003.html | 106 ++ .../workers/semantics/interface-objects/004.html | 73 ++ .../workers/semantics/multiple-workers/001.html | 41 + .../workers/semantics/multiple-workers/002.html | 28 + .../workers/semantics/multiple-workers/003.html | 34 + .../workers/semantics/multiple-workers/004-1.html | 7 + .../workers/semantics/multiple-workers/004-2.js | 6 + .../workers/semantics/multiple-workers/004.html | 34 + .../workers/semantics/multiple-workers/005.html | 37 + .../workers/semantics/multiple-workers/006-1.js | 3 + .../workers/semantics/multiple-workers/006.html | 35 + .../workers/semantics/multiple-workers/007.html | 39 + .../workers/semantics/multiple-workers/008-1.html | 8 + .../workers/semantics/multiple-workers/008.html | 31 + .../tests/workers/semantics/navigation/001-1.html | 23 + .../tests/workers/semantics/navigation/001.html | 36 + .../tests/workers/semantics/navigation/002.html | 36 + .../workers/semantics/reporting-errors/001.html | 53 + .../workers/semantics/reporting-errors/002.html | 59 ++ .../workers/semantics/reporting-errors/003.html | 39 + .../workers/semantics/reporting-errors/004-1.html | 18 + .../workers/semantics/reporting-errors/004.html | 39 + .../tests/workers/semantics/run-a-worker/001.html | 22 + .../tests/workers/semantics/run-a-worker/002.html | 24 + .../tests/workers/semantics/run-a-worker/003.html | 21 + .../workers/semantics/structured-clone/common.js | 596 ++++++++++++ .../semantics/structured-clone/dedicated.html | 9 + .../semantics/structured-clone/dedicated.js | 4 + .../workers/semantics/structured-clone/shared.html | 9 + .../workers/semantics/structured-clone/shared.js | 6 + .../semantics/structured-clone/worker-common.js | 1018 ++++++++++++++++++++ .../tests/workers/semantics/xhr/001-1.xml | 1 + .../tests/workers/semantics/xhr/001.html | 35 + .../tests/workers/semantics/xhr/002.html | 32 + .../tests/workers/semantics/xhr/003.html | 41 + .../tests/workers/semantics/xhr/004.html | 36 + .../tests/workers/semantics/xhr/005.html | 21 + .../tests/workers/semantics/xhr/006.html | 21 + .../tests/workers/semantics/xhr/support/001-1.xml | 1 + .../tests/workers/semantics/xhr/support/005-1.js | 5 + .../tests/workers/semantics/xhr/support/006-1.js | 7 + .../tests/workers/support/ErrorEvent-error.js | 9 + .../tests/workers/support/ErrorEvent.js | 10 + .../tests/workers/support/ImportScripts.js | 9 + .../workers/support/ImportScriptsNetworkErr.js | 15 + .../web-platform/tests/workers/support/Timer.js | 50 + .../tests/workers/support/WorkerBasic.js | 7 + .../tests/workers/support/WorkerClose.js | 5 + .../tests/workers/support/WorkerDataCloneErr.js | 15 + .../tests/workers/support/WorkerLocation.js | 12 + .../tests/workers/support/WorkerNavigator.js | 8 + .../tests/workers/support/WorkerTerminate.js | 10 + .../tests/workers/support/WorkerText.txt | 2 + 244 files changed, 6617 insertions(+) create mode 100644 testing/web-platform/tests/workers/OWNERS create mode 100644 testing/web-platform/tests/workers/README.md create mode 100644 testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_colno.htm create mode 100644 testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_filename.htm create mode 100644 testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_lineno.htm create mode 100644 testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_message.htm create mode 100644 testing/web-platform/tests/workers/WorkerGlobalScope_close.htm create mode 100644 testing/web-platform/tests/workers/WorkerGlobalScope_importScripts.htm create mode 100644 testing/web-platform/tests/workers/WorkerGlobalScope_importScripts_NetworkErr.htm create mode 100644 testing/web-platform/tests/workers/WorkerGlobalScope_setInterval.htm create mode 100644 testing/web-platform/tests/workers/WorkerGlobalScope_setTimeout.htm create mode 100644 testing/web-platform/tests/workers/WorkerLocation.htm create mode 100644 testing/web-platform/tests/workers/WorkerLocation_hash.htm create mode 100644 testing/web-platform/tests/workers/WorkerLocation_hash_encoding.htm create mode 100644 testing/web-platform/tests/workers/WorkerLocation_hash_nonexist.htm create mode 100644 testing/web-platform/tests/workers/WorkerLocation_host.htm create mode 100644 testing/web-platform/tests/workers/WorkerLocation_hostname.htm create mode 100644 testing/web-platform/tests/workers/WorkerLocation_href.htm create mode 100644 testing/web-platform/tests/workers/WorkerLocation_pathname.htm create mode 100644 testing/web-platform/tests/workers/WorkerLocation_port.htm create mode 100644 testing/web-platform/tests/workers/WorkerLocation_protocol.htm create mode 100644 testing/web-platform/tests/workers/WorkerLocation_search.htm create mode 100644 testing/web-platform/tests/workers/WorkerLocation_search_empty.htm create mode 100644 testing/web-platform/tests/workers/WorkerLocation_search_fragment.htm create mode 100644 testing/web-platform/tests/workers/WorkerLocation_search_nonexist.htm create mode 100644 testing/web-platform/tests/workers/WorkerNavigator_appName.htm create mode 100644 testing/web-platform/tests/workers/WorkerNavigator_appVersion.htm create mode 100644 testing/web-platform/tests/workers/WorkerNavigator_onLine.htm create mode 100644 testing/web-platform/tests/workers/WorkerNavigator_platform.htm create mode 100644 testing/web-platform/tests/workers/WorkerNavigator_userAgent.htm create mode 100644 testing/web-platform/tests/workers/Worker_ErrorEvent_bubbles_cancelable.htm create mode 100644 testing/web-platform/tests/workers/Worker_ErrorEvent_error.htm create mode 100644 testing/web-platform/tests/workers/Worker_ErrorEvent_filename.htm create mode 100644 testing/web-platform/tests/workers/Worker_ErrorEvent_lineno.htm create mode 100644 testing/web-platform/tests/workers/Worker_ErrorEvent_message.htm create mode 100644 testing/web-platform/tests/workers/Worker_ErrorEvent_type.htm create mode 100644 testing/web-platform/tests/workers/Worker_basic.htm create mode 100644 testing/web-platform/tests/workers/Worker_cross_origin_security_err.htm create mode 100644 testing/web-platform/tests/workers/Worker_dispatchEvent_ErrorEvent.htm create mode 100644 testing/web-platform/tests/workers/Worker_script_mimetype.htm create mode 100644 testing/web-platform/tests/workers/Worker_terminate_event_queue.htm create mode 100644 testing/web-platform/tests/workers/baseurl/alpha/importScripts.html create mode 100644 testing/web-platform/tests/workers/baseurl/alpha/sharedworker.html create mode 100644 testing/web-platform/tests/workers/baseurl/alpha/worker.html create mode 100644 testing/web-platform/tests/workers/baseurl/alpha/xhr.html create mode 100644 testing/web-platform/tests/workers/baseurl/beta/importScripts.py create mode 100644 testing/web-platform/tests/workers/baseurl/beta/script.js create mode 100644 testing/web-platform/tests/workers/baseurl/beta/sharedworker.py create mode 100644 testing/web-platform/tests/workers/baseurl/beta/subsharedworker.js create mode 100644 testing/web-platform/tests/workers/baseurl/beta/subworker.js create mode 100644 testing/web-platform/tests/workers/baseurl/beta/test.txt create mode 100644 testing/web-platform/tests/workers/baseurl/beta/worker.py create mode 100644 testing/web-platform/tests/workers/baseurl/beta/xhr.py create mode 100644 testing/web-platform/tests/workers/baseurl/gamma/importScripts.js create mode 100644 testing/web-platform/tests/workers/baseurl/gamma/script.js create mode 100644 testing/web-platform/tests/workers/baseurl/gamma/sharedworker.js create mode 100644 testing/web-platform/tests/workers/baseurl/gamma/subsharedworker.js create mode 100644 testing/web-platform/tests/workers/baseurl/gamma/subworker.js create mode 100644 testing/web-platform/tests/workers/baseurl/gamma/test.txt create mode 100644 testing/web-platform/tests/workers/baseurl/gamma/worker.js create mode 100644 testing/web-platform/tests/workers/baseurl/gamma/xhr.js create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/1 create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/URLMismatchError.htm create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/connect-event.html create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/dummy-name.html create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/dummy-shared-worker.html create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/empty-name.html create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/global-members.html create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/interface-objects.html create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/name.html create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/no-arguments-ctor.html create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/null create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/null-arguments.html create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/number-arguments.html create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/port-onmessage.html create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/port-properties.html create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/port-readonly.html create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/setting-port-members.html create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/shared-worker.js create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/undefined create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/undefined-arguments.html create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/unexpected-global-properties.html create mode 100644 testing/web-platform/tests/workers/constructors/SharedWorker/unresolvable-url.html create mode 100644 testing/web-platform/tests/workers/constructors/Worker/1 create mode 100644 testing/web-platform/tests/workers/constructors/Worker/AbstractWorker.onerror.html create mode 100644 testing/web-platform/tests/workers/constructors/Worker/Blob-url.html create mode 100644 testing/web-platform/tests/workers/constructors/Worker/DedicatedWorkerGlobalScope-members.worker.js create mode 100644 testing/web-platform/tests/workers/constructors/Worker/ctor-1.html create mode 100644 testing/web-platform/tests/workers/constructors/Worker/ctor-null.html create mode 100644 testing/web-platform/tests/workers/constructors/Worker/ctor-undefined.html create mode 100644 testing/web-platform/tests/workers/constructors/Worker/expected-self-properties.worker.js create mode 100644 testing/web-platform/tests/workers/constructors/Worker/no-arguments-ctor.html create mode 100644 testing/web-platform/tests/workers/constructors/Worker/null create mode 100644 testing/web-platform/tests/workers/constructors/Worker/resolve-empty-string.html create mode 100644 testing/web-platform/tests/workers/constructors/Worker/same-origin.html create mode 100644 testing/web-platform/tests/workers/constructors/Worker/sample_worker/worker.js create mode 100644 testing/web-platform/tests/workers/constructors/Worker/terminate.html create mode 100644 testing/web-platform/tests/workers/constructors/Worker/undefined create mode 100644 testing/web-platform/tests/workers/constructors/Worker/unexpected-self-properties.worker.js create mode 100644 testing/web-platform/tests/workers/constructors/Worker/unresolvable-url.html create mode 100644 testing/web-platform/tests/workers/constructors/Worker/use-base-url.html create mode 100644 testing/web-platform/tests/workers/interfaces.idl create mode 100644 testing/web-platform/tests/workers/interfaces.worker.js create mode 100644 testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/EventTarget.worker.js create mode 100644 testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/onmessage.worker.js create mode 100644 testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/event-ports-dedicated.html create mode 100644 testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/imagedata-cloned-canvas-in-array.html create mode 100644 testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/message-event.html create mode 100644 testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/message-event.js create mode 100644 testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/return-value.worker.js create mode 100644 testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-null-in-array.html create mode 100644 testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-null.html create mode 100644 testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-undefined.html create mode 100644 testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/setting-postMessage.html create mode 100644 testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/structured-clone-imagedata.html create mode 100644 testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/structured-clone-message.html create mode 100644 testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope/name/getting.html create mode 100644 testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope/name/setting.html create mode 100644 testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope/onconnect.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/close/incoming-message.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/close/sending-messages.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/close/setInterval.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/close/setTimeout.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/helper-redirect.py create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/members.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/post-location-members.js create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/redirect.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/returns-same-object.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/setting-members.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/worker-separate-file.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/exception-in-onerror.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/handled.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/not-handled.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/propagate-to-window-onerror.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/self.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/WindowTimers/001.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/WindowTimers/002.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/WindowTimers/003.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/WindowTimers/004.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/001.worker.js create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/002.worker.js create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/003.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/004.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/005.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/006.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/007.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/008.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/009.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/010.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/011.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/012.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/1 create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/null create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/undefined create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/002.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/003.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/004.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/005.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/006.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/007.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/language.html create mode 100644 testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/window-only.worker.js create mode 100644 testing/web-platform/tests/workers/nested_worker.worker.js create mode 100644 testing/web-platform/tests/workers/non-automated/application-cache-dedicated.html create mode 100644 testing/web-platform/tests/workers/non-automated/application-cache-dedicated.js create mode 100644 testing/web-platform/tests/workers/non-automated/cache.manifest create mode 100644 testing/web-platform/tests/workers/non-automated/infinite-nested.html create mode 100644 testing/web-platform/tests/workers/non-automated/infinite-nested.js create mode 100644 testing/web-platform/tests/workers/non-automated/infinite-sibling-and-nested.html create mode 100644 testing/web-platform/tests/workers/non-automated/infinite-sibling-and-nested.js create mode 100644 testing/web-platform/tests/workers/non-automated/infinite-sibling.html create mode 100644 testing/web-platform/tests/workers/non-automated/infinite-sibling.js create mode 100644 testing/web-platform/tests/workers/non-automated/navigator-onLine.html create mode 100644 testing/web-platform/tests/workers/non-automated/post-a-1.js create mode 100644 testing/web-platform/tests/workers/postMessage_DataCloneErr.htm create mode 100644 testing/web-platform/tests/workers/postMessage_clone_port.htm create mode 100644 testing/web-platform/tests/workers/postMessage_clone_port_error.htm create mode 100644 testing/web-platform/tests/workers/postMessage_event_properties.htm create mode 100644 testing/web-platform/tests/workers/postMessage_ports_readonly_array.htm create mode 100644 testing/web-platform/tests/workers/postMessage_target_source.htm create mode 100644 testing/web-platform/tests/workers/semantics/encodings/001.html create mode 100644 testing/web-platform/tests/workers/semantics/encodings/001.html.headers create mode 100644 testing/web-platform/tests/workers/semantics/encodings/002.html create mode 100644 testing/web-platform/tests/workers/semantics/encodings/002.html.headers create mode 100644 testing/web-platform/tests/workers/semantics/encodings/003-1.py create mode 100644 testing/web-platform/tests/workers/semantics/encodings/003.html create mode 100644 testing/web-platform/tests/workers/semantics/encodings/004.html create mode 100644 testing/web-platform/tests/workers/semantics/encodings/004.worker.js create mode 100644 testing/web-platform/tests/workers/semantics/interface-objects/001.worker.js create mode 100644 testing/web-platform/tests/workers/semantics/interface-objects/002.worker.js create mode 100644 testing/web-platform/tests/workers/semantics/interface-objects/003.html create mode 100644 testing/web-platform/tests/workers/semantics/interface-objects/004.html create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/001.html create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/002.html create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/003.html create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/004-1.html create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/004-2.js create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/004.html create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/005.html create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/006-1.js create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/006.html create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/007.html create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/008-1.html create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/008.html create mode 100644 testing/web-platform/tests/workers/semantics/navigation/001-1.html create mode 100644 testing/web-platform/tests/workers/semantics/navigation/001.html create mode 100644 testing/web-platform/tests/workers/semantics/navigation/002.html create mode 100644 testing/web-platform/tests/workers/semantics/reporting-errors/001.html create mode 100644 testing/web-platform/tests/workers/semantics/reporting-errors/002.html create mode 100644 testing/web-platform/tests/workers/semantics/reporting-errors/003.html create mode 100644 testing/web-platform/tests/workers/semantics/reporting-errors/004-1.html create mode 100644 testing/web-platform/tests/workers/semantics/reporting-errors/004.html create mode 100644 testing/web-platform/tests/workers/semantics/run-a-worker/001.html create mode 100644 testing/web-platform/tests/workers/semantics/run-a-worker/002.html create mode 100644 testing/web-platform/tests/workers/semantics/run-a-worker/003.html create mode 100644 testing/web-platform/tests/workers/semantics/structured-clone/common.js create mode 100644 testing/web-platform/tests/workers/semantics/structured-clone/dedicated.html create mode 100644 testing/web-platform/tests/workers/semantics/structured-clone/dedicated.js create mode 100644 testing/web-platform/tests/workers/semantics/structured-clone/shared.html create mode 100644 testing/web-platform/tests/workers/semantics/structured-clone/shared.js create mode 100644 testing/web-platform/tests/workers/semantics/structured-clone/worker-common.js create mode 100644 testing/web-platform/tests/workers/semantics/xhr/001-1.xml create mode 100644 testing/web-platform/tests/workers/semantics/xhr/001.html create mode 100644 testing/web-platform/tests/workers/semantics/xhr/002.html create mode 100644 testing/web-platform/tests/workers/semantics/xhr/003.html create mode 100644 testing/web-platform/tests/workers/semantics/xhr/004.html create mode 100644 testing/web-platform/tests/workers/semantics/xhr/005.html create mode 100644 testing/web-platform/tests/workers/semantics/xhr/006.html create mode 100644 testing/web-platform/tests/workers/semantics/xhr/support/001-1.xml create mode 100644 testing/web-platform/tests/workers/semantics/xhr/support/005-1.js create mode 100644 testing/web-platform/tests/workers/semantics/xhr/support/006-1.js create mode 100644 testing/web-platform/tests/workers/support/ErrorEvent-error.js create mode 100644 testing/web-platform/tests/workers/support/ErrorEvent.js create mode 100644 testing/web-platform/tests/workers/support/ImportScripts.js create mode 100644 testing/web-platform/tests/workers/support/ImportScriptsNetworkErr.js create mode 100644 testing/web-platform/tests/workers/support/Timer.js create mode 100644 testing/web-platform/tests/workers/support/WorkerBasic.js create mode 100644 testing/web-platform/tests/workers/support/WorkerClose.js create mode 100644 testing/web-platform/tests/workers/support/WorkerDataCloneErr.js create mode 100644 testing/web-platform/tests/workers/support/WorkerLocation.js create mode 100644 testing/web-platform/tests/workers/support/WorkerNavigator.js create mode 100644 testing/web-platform/tests/workers/support/WorkerTerminate.js create mode 100644 testing/web-platform/tests/workers/support/WorkerText.txt (limited to 'testing/web-platform/tests/workers') diff --git a/testing/web-platform/tests/workers/OWNERS b/testing/web-platform/tests/workers/OWNERS new file mode 100644 index 000000000..d211ea968 --- /dev/null +++ b/testing/web-platform/tests/workers/OWNERS @@ -0,0 +1,6 @@ +@zqzhang +@chunywang +@zcorpan +@caitp +@Ms2ger +@jdm diff --git a/testing/web-platform/tests/workers/README.md b/testing/web-platform/tests/workers/README.md new file mode 100644 index 000000000..3a1c58f3b --- /dev/null +++ b/testing/web-platform/tests/workers/README.md @@ -0,0 +1,8 @@ +This directory contains the Web Workers test suite. + +To run this test suite within a browser, go to: . + +The latest Editor's Draft of Web Workers is: . + +The latest W3C Technical Report of Web Workers is . + diff --git a/testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_colno.htm b/testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_colno.htm new file mode 100644 index 000000000..793d6c180 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_colno.htm @@ -0,0 +1,18 @@ + + WorkerGlobalScope onerror event handler argument: col + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_filename.htm b/testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_filename.htm new file mode 100644 index 000000000..e165a23f4 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_filename.htm @@ -0,0 +1,20 @@ + + WorkerGlobalScope onerror event handler argument: location + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_lineno.htm b/testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_lineno.htm new file mode 100644 index 000000000..dfbc51467 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_lineno.htm @@ -0,0 +1,18 @@ + + WorkerGlobalScope onerror event handler argument: line + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_message.htm b/testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_message.htm new file mode 100644 index 000000000..bc1d2c45b --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerGlobalScope_ErrorEvent_message.htm @@ -0,0 +1,19 @@ + + WorkerGlobalScope onerror event handler argument: message + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerGlobalScope_close.htm b/testing/web-platform/tests/workers/WorkerGlobalScope_close.htm new file mode 100644 index 000000000..2ad5205d1 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerGlobalScope_close.htm @@ -0,0 +1,17 @@ + + WorkerGlobalScope close(): clear events queue + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerGlobalScope_importScripts.htm b/testing/web-platform/tests/workers/WorkerGlobalScope_importScripts.htm new file mode 100644 index 000000000..1a3616df9 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerGlobalScope_importScripts.htm @@ -0,0 +1,14 @@ + + WorkerGlobalScope API: importScripts() + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerGlobalScope_importScripts_NetworkErr.htm b/testing/web-platform/tests/workers/WorkerGlobalScope_importScripts_NetworkErr.htm new file mode 100644 index 000000000..36fe6e0b2 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerGlobalScope_importScripts_NetworkErr.htm @@ -0,0 +1,13 @@ + + importScripts() with non-existent script file + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerGlobalScope_setInterval.htm b/testing/web-platform/tests/workers/WorkerGlobalScope_setInterval.htm new file mode 100644 index 000000000..4e147fbf6 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerGlobalScope_setInterval.htm @@ -0,0 +1,20 @@ + + WorkerGlobalScope API: setInterval() + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerGlobalScope_setTimeout.htm b/testing/web-platform/tests/workers/WorkerGlobalScope_setTimeout.htm new file mode 100644 index 000000000..89fdf3d74 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerGlobalScope_setTimeout.htm @@ -0,0 +1,20 @@ + + WorkerGlobalScope API: setTimeout() + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerLocation.htm b/testing/web-platform/tests/workers/WorkerLocation.htm new file mode 100644 index 000000000..a74f13a8b --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerLocation.htm @@ -0,0 +1,15 @@ + + WorkerLocation object + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerLocation_hash.htm b/testing/web-platform/tests/workers/WorkerLocation_hash.htm new file mode 100644 index 000000000..74a424efc --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerLocation_hash.htm @@ -0,0 +1,13 @@ + + WorkerLocation URL decomposition IDL attribute: hash + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerLocation_hash_encoding.htm b/testing/web-platform/tests/workers/WorkerLocation_hash_encoding.htm new file mode 100644 index 000000000..b2a171a09 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerLocation_hash_encoding.htm @@ -0,0 +1,13 @@ + + WorkerLocation.hash with url encoding string + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerLocation_hash_nonexist.htm b/testing/web-platform/tests/workers/WorkerLocation_hash_nonexist.htm new file mode 100644 index 000000000..2d898c075 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerLocation_hash_nonexist.htm @@ -0,0 +1,13 @@ + + WorkerLocation.hash with no <fragment> component + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerLocation_host.htm b/testing/web-platform/tests/workers/WorkerLocation_host.htm new file mode 100644 index 000000000..53286ddfc --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerLocation_host.htm @@ -0,0 +1,13 @@ + + WorkerLocation URL decomposition IDL attribute: host + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerLocation_hostname.htm b/testing/web-platform/tests/workers/WorkerLocation_hostname.htm new file mode 100644 index 000000000..97250805c --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerLocation_hostname.htm @@ -0,0 +1,13 @@ + + WorkerLocation URL decomposition IDL attribute: hostname + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerLocation_href.htm b/testing/web-platform/tests/workers/WorkerLocation_href.htm new file mode 100644 index 000000000..3ed1dbd4f --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerLocation_href.htm @@ -0,0 +1,15 @@ + + WorkerLocation href attribute + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerLocation_pathname.htm b/testing/web-platform/tests/workers/WorkerLocation_pathname.htm new file mode 100644 index 000000000..346984511 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerLocation_pathname.htm @@ -0,0 +1,15 @@ + + WorkerLocation URL decomposition IDL attribute: pathname + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerLocation_port.htm b/testing/web-platform/tests/workers/WorkerLocation_port.htm new file mode 100644 index 000000000..ef86cfacb --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerLocation_port.htm @@ -0,0 +1,13 @@ + + WorkerLocation URL decomposition IDL attribute: port + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerLocation_protocol.htm b/testing/web-platform/tests/workers/WorkerLocation_protocol.htm new file mode 100644 index 000000000..f792dee51 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerLocation_protocol.htm @@ -0,0 +1,13 @@ + + WorkerLocation URL decomposition IDL attribute: protocol + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerLocation_search.htm b/testing/web-platform/tests/workers/WorkerLocation_search.htm new file mode 100644 index 000000000..bc6add876 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerLocation_search.htm @@ -0,0 +1,13 @@ + + WorkerLocation URL decomposition IDL attribute: search + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerLocation_search_empty.htm b/testing/web-platform/tests/workers/WorkerLocation_search_empty.htm new file mode 100644 index 000000000..a32d43091 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerLocation_search_empty.htm @@ -0,0 +1,13 @@ + + WorkerLocation.search with empty <query> + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerLocation_search_fragment.htm b/testing/web-platform/tests/workers/WorkerLocation_search_fragment.htm new file mode 100644 index 000000000..3ec4cffa6 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerLocation_search_fragment.htm @@ -0,0 +1,13 @@ + + WorkerLocation.search with <fragment> in <query> + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerLocation_search_nonexist.htm b/testing/web-platform/tests/workers/WorkerLocation_search_nonexist.htm new file mode 100644 index 000000000..9907e6473 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerLocation_search_nonexist.htm @@ -0,0 +1,13 @@ + + WorkerLocation.search with no <query> component + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerNavigator_appName.htm b/testing/web-platform/tests/workers/WorkerNavigator_appName.htm new file mode 100644 index 000000000..832c46ff5 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerNavigator_appName.htm @@ -0,0 +1,13 @@ + + WorkerNavigator appName + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerNavigator_appVersion.htm b/testing/web-platform/tests/workers/WorkerNavigator_appVersion.htm new file mode 100644 index 000000000..7deaa4256 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerNavigator_appVersion.htm @@ -0,0 +1,13 @@ + + WorkerNavigator appVersion + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerNavigator_onLine.htm b/testing/web-platform/tests/workers/WorkerNavigator_onLine.htm new file mode 100644 index 000000000..f9e819b8a --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerNavigator_onLine.htm @@ -0,0 +1,13 @@ + + WorkerNavigator.onLine + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerNavigator_platform.htm b/testing/web-platform/tests/workers/WorkerNavigator_platform.htm new file mode 100644 index 000000000..3a6de80eb --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerNavigator_platform.htm @@ -0,0 +1,13 @@ + + WorkerNavigator.platform + + +
+ diff --git a/testing/web-platform/tests/workers/WorkerNavigator_userAgent.htm b/testing/web-platform/tests/workers/WorkerNavigator_userAgent.htm new file mode 100644 index 000000000..8a34fb480 --- /dev/null +++ b/testing/web-platform/tests/workers/WorkerNavigator_userAgent.htm @@ -0,0 +1,13 @@ + + WorkerNavigator.userAgent + + +
+ diff --git a/testing/web-platform/tests/workers/Worker_ErrorEvent_bubbles_cancelable.htm b/testing/web-platform/tests/workers/Worker_ErrorEvent_bubbles_cancelable.htm new file mode 100644 index 000000000..4619ee7b5 --- /dev/null +++ b/testing/web-platform/tests/workers/Worker_ErrorEvent_bubbles_cancelable.htm @@ -0,0 +1,22 @@ + + +Web Workers: Worker ErrorEvent - bubbles, cancelable + + + +
+ diff --git a/testing/web-platform/tests/workers/Worker_ErrorEvent_error.htm b/testing/web-platform/tests/workers/Worker_ErrorEvent_error.htm new file mode 100644 index 000000000..1c1257d1b --- /dev/null +++ b/testing/web-platform/tests/workers/Worker_ErrorEvent_error.htm @@ -0,0 +1,29 @@ + + + + + + diff --git a/testing/web-platform/tests/workers/Worker_ErrorEvent_filename.htm b/testing/web-platform/tests/workers/Worker_ErrorEvent_filename.htm new file mode 100644 index 000000000..0faef6fea --- /dev/null +++ b/testing/web-platform/tests/workers/Worker_ErrorEvent_filename.htm @@ -0,0 +1,20 @@ + + AbstractWorker ErrorEvent.filename + + +
+ diff --git a/testing/web-platform/tests/workers/Worker_ErrorEvent_lineno.htm b/testing/web-platform/tests/workers/Worker_ErrorEvent_lineno.htm new file mode 100644 index 000000000..ad9817296 --- /dev/null +++ b/testing/web-platform/tests/workers/Worker_ErrorEvent_lineno.htm @@ -0,0 +1,18 @@ + + AbstractWorker ErrorEvent.lineno + + +
+ diff --git a/testing/web-platform/tests/workers/Worker_ErrorEvent_message.htm b/testing/web-platform/tests/workers/Worker_ErrorEvent_message.htm new file mode 100644 index 000000000..5602d9bc0 --- /dev/null +++ b/testing/web-platform/tests/workers/Worker_ErrorEvent_message.htm @@ -0,0 +1,19 @@ + + AbstractWorker ErrorEvent.message + + +
+ diff --git a/testing/web-platform/tests/workers/Worker_ErrorEvent_type.htm b/testing/web-platform/tests/workers/Worker_ErrorEvent_type.htm new file mode 100644 index 000000000..3a0f85ad9 --- /dev/null +++ b/testing/web-platform/tests/workers/Worker_ErrorEvent_type.htm @@ -0,0 +1,19 @@ + + AbstractWorker ErrorEvent.type + + +
+ diff --git a/testing/web-platform/tests/workers/Worker_basic.htm b/testing/web-platform/tests/workers/Worker_basic.htm new file mode 100644 index 000000000..d2b57b491 --- /dev/null +++ b/testing/web-platform/tests/workers/Worker_basic.htm @@ -0,0 +1,31 @@ + + Web Workers Basic Tests + + +
+ diff --git a/testing/web-platform/tests/workers/Worker_cross_origin_security_err.htm b/testing/web-platform/tests/workers/Worker_cross_origin_security_err.htm new file mode 100644 index 000000000..647a8b81e --- /dev/null +++ b/testing/web-platform/tests/workers/Worker_cross_origin_security_err.htm @@ -0,0 +1,17 @@ + + Worker cross-origin URL + + +
+ diff --git a/testing/web-platform/tests/workers/Worker_dispatchEvent_ErrorEvent.htm b/testing/web-platform/tests/workers/Worker_dispatchEvent_ErrorEvent.htm new file mode 100644 index 000000000..aea7e025c --- /dev/null +++ b/testing/web-platform/tests/workers/Worker_dispatchEvent_ErrorEvent.htm @@ -0,0 +1,37 @@ + + ErrorEvent and Worker.dispatchEvent() + + +
+ diff --git a/testing/web-platform/tests/workers/Worker_script_mimetype.htm b/testing/web-platform/tests/workers/Worker_script_mimetype.htm new file mode 100644 index 000000000..04fe68e66 --- /dev/null +++ b/testing/web-platform/tests/workers/Worker_script_mimetype.htm @@ -0,0 +1,14 @@ + + Worker constructor with script inside text file + + +
+ diff --git a/testing/web-platform/tests/workers/Worker_terminate_event_queue.htm b/testing/web-platform/tests/workers/Worker_terminate_event_queue.htm new file mode 100644 index 000000000..5d9472a1c --- /dev/null +++ b/testing/web-platform/tests/workers/Worker_terminate_event_queue.htm @@ -0,0 +1,22 @@ + + AbstractWorker terminate(): clear event queue + + +
+ diff --git a/testing/web-platform/tests/workers/baseurl/alpha/importScripts.html b/testing/web-platform/tests/workers/baseurl/alpha/importScripts.html new file mode 100644 index 000000000..0fbd35b44 --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/alpha/importScripts.html @@ -0,0 +1,14 @@ + + +Base URL in workers: importScripts + + + diff --git a/testing/web-platform/tests/workers/baseurl/alpha/sharedworker.html b/testing/web-platform/tests/workers/baseurl/alpha/sharedworker.html new file mode 100644 index 000000000..25d258236 --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/alpha/sharedworker.html @@ -0,0 +1,14 @@ + + +Base URL in workers: new SharedWorker() + + + diff --git a/testing/web-platform/tests/workers/baseurl/alpha/worker.html b/testing/web-platform/tests/workers/baseurl/alpha/worker.html new file mode 100644 index 000000000..284425ed3 --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/alpha/worker.html @@ -0,0 +1,14 @@ + + +Base URL in workers: new Worker() + + + diff --git a/testing/web-platform/tests/workers/baseurl/alpha/xhr.html b/testing/web-platform/tests/workers/baseurl/alpha/xhr.html new file mode 100644 index 000000000..9a1219b45 --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/alpha/xhr.html @@ -0,0 +1,14 @@ + + +Base URL in workers: XHR + + + diff --git a/testing/web-platform/tests/workers/baseurl/beta/importScripts.py b/testing/web-platform/tests/workers/baseurl/beta/importScripts.py new file mode 100644 index 000000000..75dac194f --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/beta/importScripts.py @@ -0,0 +1,3 @@ +def main(request, response): + return (302, "Moved"), [("Location", "../gamma/importScripts.js")], "postMessage('executed redirecting script');" + diff --git a/testing/web-platform/tests/workers/baseurl/beta/script.js b/testing/web-platform/tests/workers/baseurl/beta/script.js new file mode 100644 index 000000000..8fe3dfc13 --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/beta/script.js @@ -0,0 +1 @@ +postMessage('beta'); diff --git a/testing/web-platform/tests/workers/baseurl/beta/sharedworker.py b/testing/web-platform/tests/workers/baseurl/beta/sharedworker.py new file mode 100644 index 000000000..875cc9a04 --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/beta/sharedworker.py @@ -0,0 +1,3 @@ +def main(request, response): + return (302, "Moved"), [("Location", "../gamma/sharedworker.js")], "postMessage('executed redirecting script');" + diff --git a/testing/web-platform/tests/workers/baseurl/beta/subsharedworker.js b/testing/web-platform/tests/workers/baseurl/beta/subsharedworker.js new file mode 100644 index 000000000..de6a8caca --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/beta/subsharedworker.js @@ -0,0 +1,3 @@ +onconnect = function(e) { + e.source.postMessage('beta'); +} diff --git a/testing/web-platform/tests/workers/baseurl/beta/subworker.js b/testing/web-platform/tests/workers/baseurl/beta/subworker.js new file mode 100644 index 000000000..997cecd6c --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/beta/subworker.js @@ -0,0 +1 @@ +postMessage("beta"); diff --git a/testing/web-platform/tests/workers/baseurl/beta/test.txt b/testing/web-platform/tests/workers/baseurl/beta/test.txt new file mode 100644 index 000000000..65b2df87f --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/beta/test.txt @@ -0,0 +1 @@ +beta diff --git a/testing/web-platform/tests/workers/baseurl/beta/worker.py b/testing/web-platform/tests/workers/baseurl/beta/worker.py new file mode 100644 index 000000000..44baf5203 --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/beta/worker.py @@ -0,0 +1,3 @@ +def main(request, response): + return (302, "Moved"), [("Location", "../gamma/worker.js")], "postMessage('executed redirecting script');" + diff --git a/testing/web-platform/tests/workers/baseurl/beta/xhr.py b/testing/web-platform/tests/workers/baseurl/beta/xhr.py new file mode 100644 index 000000000..de3f04ed0 --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/beta/xhr.py @@ -0,0 +1,3 @@ +def main(request, response): + return (302, "Moved"), [("Location", "../gamma/xhr.js")], "postMessage('executed redirecting script');" + diff --git a/testing/web-platform/tests/workers/baseurl/gamma/importScripts.js b/testing/web-platform/tests/workers/baseurl/gamma/importScripts.js new file mode 100644 index 000000000..3f7685645 --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/gamma/importScripts.js @@ -0,0 +1 @@ +importScripts("script.js"); diff --git a/testing/web-platform/tests/workers/baseurl/gamma/script.js b/testing/web-platform/tests/workers/baseurl/gamma/script.js new file mode 100644 index 000000000..dddf2240c --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/gamma/script.js @@ -0,0 +1 @@ +postMessage('gamma'); diff --git a/testing/web-platform/tests/workers/baseurl/gamma/sharedworker.js b/testing/web-platform/tests/workers/baseurl/gamma/sharedworker.js new file mode 100644 index 000000000..d0718cfde --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/gamma/sharedworker.js @@ -0,0 +1,4 @@ +var worker = new SharedWorker("subsharedworker.js"); +worker.port.onmessage = function(e) { + postMessage(e.data); +} diff --git a/testing/web-platform/tests/workers/baseurl/gamma/subsharedworker.js b/testing/web-platform/tests/workers/baseurl/gamma/subsharedworker.js new file mode 100644 index 000000000..e23602ff9 --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/gamma/subsharedworker.js @@ -0,0 +1,3 @@ +onconnect = function(e) { + e.source.postMessage('gamma'); +} diff --git a/testing/web-platform/tests/workers/baseurl/gamma/subworker.js b/testing/web-platform/tests/workers/baseurl/gamma/subworker.js new file mode 100644 index 000000000..44407358e --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/gamma/subworker.js @@ -0,0 +1 @@ +postMessage("gamma"); diff --git a/testing/web-platform/tests/workers/baseurl/gamma/test.txt b/testing/web-platform/tests/workers/baseurl/gamma/test.txt new file mode 100644 index 000000000..af17f6cc8 --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/gamma/test.txt @@ -0,0 +1 @@ +gamma diff --git a/testing/web-platform/tests/workers/baseurl/gamma/worker.js b/testing/web-platform/tests/workers/baseurl/gamma/worker.js new file mode 100644 index 000000000..8cfbcaef3 --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/gamma/worker.js @@ -0,0 +1,4 @@ +var worker = new Worker("subworker.js"); +worker.onmessage = function(e) { + postMessage(e.data); +} diff --git a/testing/web-platform/tests/workers/baseurl/gamma/xhr.js b/testing/web-platform/tests/workers/baseurl/gamma/xhr.js new file mode 100644 index 000000000..70f331565 --- /dev/null +++ b/testing/web-platform/tests/workers/baseurl/gamma/xhr.js @@ -0,0 +1,4 @@ +var x = new XMLHttpRequest(); +x.open("GET", "test.txt", false); +x.send(); +postMessage(x.response); diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/1 b/testing/web-platform/tests/workers/constructors/SharedWorker/1 new file mode 100644 index 000000000..c3f67beea --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/1 @@ -0,0 +1,3 @@ +onconnect = function(e) { + e.ports[0].postMessage(['1', self.name]); +} \ No newline at end of file diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/URLMismatchError.htm b/testing/web-platform/tests/workers/constructors/SharedWorker/URLMismatchError.htm new file mode 100644 index 000000000..e74e66072 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/URLMismatchError.htm @@ -0,0 +1,19 @@ + + +Web Workers: SharedWorker - throw URLMismatchError + + + +
+ diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/connect-event.html b/testing/web-platform/tests/workers/constructors/SharedWorker/connect-event.html new file mode 100644 index 000000000..a9719d9de --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/connect-event.html @@ -0,0 +1,26 @@ + + +connect event + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/dummy-name.html b/testing/web-platform/tests/workers/constructors/SharedWorker/dummy-name.html new file mode 100644 index 000000000..9e2732923 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/dummy-name.html @@ -0,0 +1,17 @@ + + +creating a dummy shared worker with name "foo" + + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/dummy-shared-worker.html b/testing/web-platform/tests/workers/constructors/SharedWorker/dummy-shared-worker.html new file mode 100644 index 000000000..e9aff9c5b --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/dummy-shared-worker.html @@ -0,0 +1,17 @@ + + +creating a dummy shared worker + + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/empty-name.html b/testing/web-platform/tests/workers/constructors/SharedWorker/empty-name.html new file mode 100644 index 000000000..95ff6d1ad --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/empty-name.html @@ -0,0 +1,17 @@ + + +creating a dummy shared worker with explicit name "" + + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/global-members.html b/testing/web-platform/tests/workers/constructors/SharedWorker/global-members.html new file mode 100644 index 000000000..af4eb1d45 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/global-members.html @@ -0,0 +1,34 @@ + + +members of SharedWorkerGlobalScope + + +
+ + + + + + diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/interface-objects.html b/testing/web-platform/tests/workers/constructors/SharedWorker/interface-objects.html new file mode 100644 index 000000000..e91b2dc6a --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/interface-objects.html @@ -0,0 +1,41 @@ + + +expected interface objects/constructors + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/name.html b/testing/web-platform/tests/workers/constructors/SharedWorker/name.html new file mode 100644 index 000000000..823e16c7c --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/name.html @@ -0,0 +1,24 @@ + + +self.name + + +
+ + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/no-arguments-ctor.html b/testing/web-platform/tests/workers/constructors/SharedWorker/no-arguments-ctor.html new file mode 100644 index 000000000..eaee870db --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/no-arguments-ctor.html @@ -0,0 +1,20 @@ + + +no arguments + + + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/null b/testing/web-platform/tests/workers/constructors/SharedWorker/null new file mode 100644 index 000000000..5c38505b6 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/null @@ -0,0 +1,3 @@ +onconnect = function(e) { + e.ports[0].postMessage(['null', self.name]); +} \ No newline at end of file diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/null-arguments.html b/testing/web-platform/tests/workers/constructors/SharedWorker/null-arguments.html new file mode 100644 index 000000000..c711b2cb5 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/null-arguments.html @@ -0,0 +1,25 @@ + + +null as arguments + + +
+ + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/number-arguments.html b/testing/web-platform/tests/workers/constructors/SharedWorker/number-arguments.html new file mode 100644 index 000000000..1a4cfb2ea --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/number-arguments.html @@ -0,0 +1,25 @@ + + +1 as arguments + + +
+ + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/port-onmessage.html b/testing/web-platform/tests/workers/constructors/SharedWorker/port-onmessage.html new file mode 100644 index 000000000..a2f4df0bf --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/port-onmessage.html @@ -0,0 +1,23 @@ + + +worker.port.onmessage + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/port-properties.html b/testing/web-platform/tests/workers/constructors/SharedWorker/port-properties.html new file mode 100644 index 000000000..f8a676dd2 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/port-properties.html @@ -0,0 +1,26 @@ + + +worker.port + + + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/port-readonly.html b/testing/web-platform/tests/workers/constructors/SharedWorker/port-readonly.html new file mode 100644 index 000000000..f087ab0f6 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/port-readonly.html @@ -0,0 +1,21 @@ + + +setting worker.port + + + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html b/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html new file mode 100644 index 000000000..2e0dd8db3 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html @@ -0,0 +1,67 @@ + + +same-origin checks + + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/setting-port-members.html b/testing/web-platform/tests/workers/constructors/SharedWorker/setting-port-members.html new file mode 100644 index 000000000..8c79ff295 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/setting-port-members.html @@ -0,0 +1,59 @@ + + +setting members of worker.port + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/shared-worker.js b/testing/web-platform/tests/workers/constructors/SharedWorker/shared-worker.js new file mode 100644 index 000000000..babebb1ce --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/shared-worker.js @@ -0,0 +1,6 @@ +onconnect = function(e) { + var port = e.ports[0]; + port.onmessage = function(e) { + port.postMessage('ping'); + } +} diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/undefined b/testing/web-platform/tests/workers/constructors/SharedWorker/undefined new file mode 100644 index 000000000..3fe840d30 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/undefined @@ -0,0 +1,3 @@ +onconnect = function(e) { + e.ports[0].postMessage(['undefined', self.name]); +} \ No newline at end of file diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/undefined-arguments.html b/testing/web-platform/tests/workers/constructors/SharedWorker/undefined-arguments.html new file mode 100644 index 000000000..b9a3b3692 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/undefined-arguments.html @@ -0,0 +1,25 @@ + + +undefined as arguments + + +
+ + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/unexpected-global-properties.html b/testing/web-platform/tests/workers/constructors/SharedWorker/unexpected-global-properties.html new file mode 100644 index 000000000..39739022d --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/unexpected-global-properties.html @@ -0,0 +1,30 @@ + + +unexpected members/interface objects/constructors + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/unresolvable-url.html b/testing/web-platform/tests/workers/constructors/SharedWorker/unresolvable-url.html new file mode 100644 index 000000000..2ca3d93d3 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/unresolvable-url.html @@ -0,0 +1,19 @@ + + +resolving broken url + + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/Worker/1 b/testing/web-platform/tests/workers/constructors/Worker/1 new file mode 100644 index 000000000..ea0b7c8f4 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/1 @@ -0,0 +1 @@ +postMessage('1'); diff --git a/testing/web-platform/tests/workers/constructors/Worker/AbstractWorker.onerror.html b/testing/web-platform/tests/workers/constructors/Worker/AbstractWorker.onerror.html new file mode 100644 index 000000000..c40424d65 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/AbstractWorker.onerror.html @@ -0,0 +1,48 @@ + + +AbstractWorker.onerror + + + + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/Worker/Blob-url.html b/testing/web-platform/tests/workers/constructors/Worker/Blob-url.html new file mode 100644 index 000000000..168fc91ae --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/Blob-url.html @@ -0,0 +1,21 @@ + + +Web Workers: Worker - Blob url + + + +
+ diff --git a/testing/web-platform/tests/workers/constructors/Worker/DedicatedWorkerGlobalScope-members.worker.js b/testing/web-platform/tests/workers/constructors/Worker/DedicatedWorkerGlobalScope-members.worker.js new file mode 100644 index 000000000..2ef466ccd --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/DedicatedWorkerGlobalScope-members.worker.js @@ -0,0 +1,18 @@ +importScripts("/resources/testharness.js"); + +var expected = [ + 'postMessage', 'onmessage', /* DedicatedWorkerGlobalScope */ + 'self', 'location', 'close', 'onerror', 'onoffline', 'ononline', /* WorkerGlobalScope */ + 'addEventListener', 'removeEventListener', 'dispatchEvent', /* EventListener */ + 'importScripts', 'navigator', /* WorkerUtils */ + 'setTimeout', 'clearTimeout', 'setInterval', 'clearInterval', /* WindowTimers */ + 'btoa', 'atob' /* WindowBase64 */ +]; +for (var i = 0; i < expected.length; ++i) { + var property = expected[i]; + test(function() { + assert_true(property in self); + }, "existence of " + property); +} + +done(); diff --git a/testing/web-platform/tests/workers/constructors/Worker/ctor-1.html b/testing/web-platform/tests/workers/constructors/Worker/ctor-1.html new file mode 100644 index 000000000..bd865261f --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/ctor-1.html @@ -0,0 +1,23 @@ + + +1 as argument + + + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/Worker/ctor-null.html b/testing/web-platform/tests/workers/constructors/Worker/ctor-null.html new file mode 100644 index 000000000..94ab71aef --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/ctor-null.html @@ -0,0 +1,23 @@ + + +null as argument + + + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/Worker/ctor-undefined.html b/testing/web-platform/tests/workers/constructors/Worker/ctor-undefined.html new file mode 100644 index 000000000..2d9eb6e65 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/ctor-undefined.html @@ -0,0 +1,23 @@ + + +undefined as argument + + + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/Worker/expected-self-properties.worker.js b/testing/web-platform/tests/workers/constructors/Worker/expected-self-properties.worker.js new file mode 100644 index 000000000..0ce41b59e --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/expected-self-properties.worker.js @@ -0,0 +1,11 @@ +importScripts("/resources/testharness.js"); + +var expected = ['XMLHttpRequest', 'WebSocket', 'EventSource', 'MessageChannel', 'Worker', 'SharedWorker']; +for (var i = 0; i < expected.length; ++i) { + var property = expected[i]; + test(function() { + assert_true(property in self); + }, "existence of " + property); +} + +done(); diff --git a/testing/web-platform/tests/workers/constructors/Worker/no-arguments-ctor.html b/testing/web-platform/tests/workers/constructors/Worker/no-arguments-ctor.html new file mode 100644 index 000000000..770c7cc93 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/no-arguments-ctor.html @@ -0,0 +1,13 @@ + + +without arguments + + + + +
+ diff --git a/testing/web-platform/tests/workers/constructors/Worker/null b/testing/web-platform/tests/workers/constructors/Worker/null new file mode 100644 index 000000000..6d079b514 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/null @@ -0,0 +1 @@ +postMessage('null'); diff --git a/testing/web-platform/tests/workers/constructors/Worker/resolve-empty-string.html b/testing/web-platform/tests/workers/constructors/Worker/resolve-empty-string.html new file mode 100644 index 000000000..0426223e0 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/resolve-empty-string.html @@ -0,0 +1,22 @@ + + + +resolve the empty string + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/Worker/same-origin.html b/testing/web-platform/tests/workers/constructors/Worker/same-origin.html new file mode 100644 index 000000000..9b0148da3 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/same-origin.html @@ -0,0 +1,63 @@ + + +same-origin checks; the script is in a script element + + + +
+ diff --git a/testing/web-platform/tests/workers/constructors/Worker/sample_worker/worker.js b/testing/web-platform/tests/workers/constructors/Worker/sample_worker/worker.js new file mode 100644 index 000000000..19bbea58e --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/sample_worker/worker.js @@ -0,0 +1 @@ +onmessage = function(event) { postMessage(event.data); } diff --git a/testing/web-platform/tests/workers/constructors/Worker/terminate.html b/testing/web-platform/tests/workers/constructors/Worker/terminate.html new file mode 100644 index 000000000..52f9707df --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/terminate.html @@ -0,0 +1,44 @@ + + +terminate() + + + +
+ + diff --git a/testing/web-platform/tests/workers/constructors/Worker/undefined b/testing/web-platform/tests/workers/constructors/Worker/undefined new file mode 100644 index 000000000..bc7f482e9 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/undefined @@ -0,0 +1 @@ +postMessage('undefined'); diff --git a/testing/web-platform/tests/workers/constructors/Worker/unexpected-self-properties.worker.js b/testing/web-platform/tests/workers/constructors/Worker/unexpected-self-properties.worker.js new file mode 100644 index 000000000..aba850116 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/unexpected-self-properties.worker.js @@ -0,0 +1,11 @@ +importScripts("/resources/testharness.js"); + +var unexpected = ['open', 'print', 'stop', 'getComputedStyle', 'getSelection', 'releaseEvents', 'captureEvents', 'alert', 'confirm', 'prompt', 'addEventStream', 'removeEventStream', 'back', 'forward', 'attachEvent', 'detachEvent', 'navigate', 'DOMParser', 'XMLSerializer', 'XPathEvaluator', 'XSLTProcessor', 'opera', 'Image', 'Option', 'frames', 'Audio', 'SVGUnitTypes', 'SVGZoomAndPan', 'java', 'netscape', 'sun', 'Packages', 'ByteArray', 'closed', 'defaultStatus', 'document', 'event', 'frameElement', 'history', 'innerHeight', 'innerWidth', 'name', 'opener', 'outerHeight', 'outerWidth', 'pageXOffset', 'pageYOffset', 'parent', 'screen', 'screenLeft', 'screenTop', 'screenX', 'screenY', 'status', 'top', 'window', 'length']; // iterated window in opera and removed expected ones +for (var i = 0; i < unexpected.length; ++i) { + var property = unexpected[i]; + test(function() { + assert_false(property in self); + }, "existence of " + property); +} + +done(); diff --git a/testing/web-platform/tests/workers/constructors/Worker/unresolvable-url.html b/testing/web-platform/tests/workers/constructors/Worker/unresolvable-url.html new file mode 100644 index 000000000..8c04b0087 --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/unresolvable-url.html @@ -0,0 +1,12 @@ + + +unresolvable url + + + +
+ diff --git a/testing/web-platform/tests/workers/constructors/Worker/use-base-url.html b/testing/web-platform/tests/workers/constructors/Worker/use-base-url.html new file mode 100644 index 000000000..94ce2a71f --- /dev/null +++ b/testing/web-platform/tests/workers/constructors/Worker/use-base-url.html @@ -0,0 +1,18 @@ + + +Use the document base url when resolving worker URLs + + + + + diff --git a/testing/web-platform/tests/workers/interfaces.idl b/testing/web-platform/tests/workers/interfaces.idl new file mode 100644 index 000000000..228efba28 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces.idl @@ -0,0 +1,106 @@ +// ----------------------------------------------------------------------------- +// DOM +// ----------------------------------------------------------------------------- +[Exposed=(Window,Worker)] +interface EventTarget { + void addEventListener(DOMString type, EventListener? callback, optional boolean capture = false); + void removeEventListener(DOMString type, EventListener? callback, optional boolean capture = false); + boolean dispatchEvent(Event event); +}; + +callback interface EventListener { + void handleEvent(Event event); +}; + +// ----------------------------------------------------------------------------- +// HTML +// ----------------------------------------------------------------------------- +[TreatNonCallableAsNull] +callback EventHandlerNonNull = any (Event event); +typedef EventHandlerNonNull? EventHandler; + +[TreatNonCallableAsNull] +callback OnErrorEventHandlerNonNull = any ((Event or DOMString) event, optional DOMString source, optional unsigned long lineno, optional unsigned long column, optional any error); +typedef OnErrorEventHandlerNonNull? OnErrorEventHandler; + +[Exposed=Worker] +interface WorkerGlobalScope : EventTarget { + readonly attribute WorkerGlobalScope self; + readonly attribute WorkerLocation location; + + void close(); + attribute OnErrorEventHandler onerror; + attribute EventHandler onlanguagechange; + attribute EventHandler onoffline; + attribute EventHandler ononline; +}; + +[Global=(Worker,DedicatedWorker),Exposed=DedicatedWorker] +/*sealed*/ interface DedicatedWorkerGlobalScope : WorkerGlobalScope { + void postMessage(any message, optional sequence transfer); + attribute EventHandler onmessage; +}; + +//[Exposed=Worker] +partial interface WorkerGlobalScope { // not obsolete + void importScripts(DOMString... urls); + readonly attribute WorkerNavigator navigator; +}; +WorkerGlobalScope implements WindowTimers; +WorkerGlobalScope implements WindowBase64; + +[NoInterfaceObject, Exposed=(Window,Worker)] +interface WindowTimers { + long setTimeout(Function handler, optional long timeout = 0, any... arguments); + long setTimeout(DOMString handler, optional long timeout = 0, any... arguments); + void clearTimeout(optional long handle = 0); + long setInterval(Function handler, optional long timeout = 0, any... arguments); + long setInterval(DOMString handler, optional long timeout = 0, any... arguments); + void clearInterval(optional long handle = 0); +}; + +[NoInterfaceObject, Exposed=(Window,Worker)] +interface WindowBase64 { + DOMString btoa(DOMString btoa); + DOMString atob(DOMString atob); +}; + +[Exposed=Worker] +interface WorkerNavigator {}; +WorkerNavigator implements NavigatorID; +WorkerNavigator implements NavigatorLanguage; +WorkerNavigator implements NavigatorOnLine; + +[NoInterfaceObject, Exposed=(Window,Worker)] +interface NavigatorID { + readonly attribute DOMString appCodeName; // constant "Mozilla" + readonly attribute DOMString appName; + readonly attribute DOMString appVersion; + readonly attribute DOMString platform; + readonly attribute DOMString product; // constant "Gecko" + readonly attribute DOMString userAgent; +}; + +[NoInterfaceObject, Exposed=(Window,Worker)] +interface NavigatorLanguage { + readonly attribute DOMString? language; + readonly attribute DOMString[] languages; +}; + +[NoInterfaceObject, Exposed=(Window,Worker)] +interface NavigatorOnLine { + readonly attribute boolean onLine; +}; + +[Exposed=Worker] +interface WorkerLocation { + stringifier readonly attribute USVString href; + readonly attribute USVString origin; + readonly attribute USVString protocol; + readonly attribute USVString host; + readonly attribute USVString hostname; + readonly attribute USVString port; + readonly attribute USVString pathname; + readonly attribute USVString search; + readonly attribute USVString hash; +}; diff --git a/testing/web-platform/tests/workers/interfaces.worker.js b/testing/web-platform/tests/workers/interfaces.worker.js new file mode 100644 index 000000000..f07669ba7 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces.worker.js @@ -0,0 +1,20 @@ +"use strict"; + +importScripts("/resources/testharness.js"); +importScripts("/resources/WebIDLParser.js", "/resources/idlharness.js"); + +var request = new XMLHttpRequest(); +request.onload = function() { + var idlArray = new IdlArray(); + var idls = request.responseText; + idlArray.add_idls(idls); + idlArray.add_objects({ + DedicatedWorkerGlobalScope: ['self'], + WorkerNavigator: ['self.navigator'], + WorkerLocation: ['self.location'], + }); + idlArray.test(); + done(); +}; +request.open("GET", "interfaces.idl"); +request.send(); diff --git a/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/EventTarget.worker.js b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/EventTarget.worker.js new file mode 100644 index 000000000..954c46c07 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/EventTarget.worker.js @@ -0,0 +1,23 @@ +importScripts("/resources/testharness.js"); + +test(function(t) { + var i = 0; + addEventListener("message", function listener(evt) { + t.step(function() { + ++i; + removeEventListener("message", listener, true); + }); + }, true); + self.dispatchEvent(new Event("message")); + self.dispatchEvent(new Event("message")); + assert_equals(i, 1); +}, "removeEventListener"); + +test(function() { + addEventListener("message", this.step_func(function(evt) { + assert_equals(evt.target, self); + }), true); + self.dispatchEvent(new Event("message")); +}, "target"); + +done(); diff --git a/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/onmessage.worker.js b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/onmessage.worker.js new file mode 100644 index 000000000..6f285caac --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/onmessage.worker.js @@ -0,0 +1,40 @@ +importScripts("/resources/testharness.js"); + +test(function() { + self.onmessage = 1; + assert_equals(self.onmessage, null, + "attribute should return null after being set to a primitive"); +}, "Setting onmessage to 1"); + +test(function() { + var object = { + handleEvent: this.unreached_func() + }; + self.onmessage = object; + assert_equals(self.onmessage, object, + "attribute should return the object it was set to."); + + self.dispatchEvent(new Event("message")); +}, "Setting onmessage to an object"); + +test(function() { + var triggered = false; + var f = function(e) { triggered = true; }; + self.onmessage = f; + assert_equals(self.onmessage, f, + "attribute should return the function it was set to."); + + self.dispatchEvent(new Event("message")); + assert_true(triggered, "event handler should have been triggered"); +}, "Setting onmessage to a function"); + + +test(function() { + assert_not_equals(self.onmessage, null, + "attribute should not return null after being set to a function"); + self.onmessage = 1; + assert_equals(self.onmessage, null, + "attribute should return null after being set to a primitive"); +}, "Setting onmessage to 1 (again)"); + +done(); diff --git a/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/event-ports-dedicated.html b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/event-ports-dedicated.html new file mode 100644 index 000000000..7ae4b0704 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/event-ports-dedicated.html @@ -0,0 +1,25 @@ + + +e.ports in dedicated worker + + +
+ + + diff --git a/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/imagedata-cloned-canvas-in-array.html b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/imagedata-cloned-canvas-in-array.html new file mode 100644 index 000000000..204130154 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/imagedata-cloned-canvas-in-array.html @@ -0,0 +1,39 @@ + + +posting an imagedata (from a cloned canvas) in an array + + +
+ + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/message-event.html b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/message-event.html new file mode 100644 index 000000000..91ec63268 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/message-event.html @@ -0,0 +1,23 @@ + + +'message' event properties + + + +
+ diff --git a/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/message-event.js b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/message-event.js new file mode 100644 index 000000000..54a250005 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/message-event.js @@ -0,0 +1 @@ +postMessage("test"); diff --git a/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/return-value.worker.js b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/return-value.worker.js new file mode 100644 index 000000000..521251699 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/return-value.worker.js @@ -0,0 +1,8 @@ +importScripts("/resources/testharness.js"); + +test(function() { + var rv = postMessage(1); + assert_equals(rv, undefined); +}, "return value of postMessage"); + +done(); diff --git a/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-null-in-array.html b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-null-in-array.html new file mode 100644 index 000000000..df4c9f83e --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-null-in-array.html @@ -0,0 +1,26 @@ + + +Using [null] in postMessage's second argument + + +
+ + + diff --git a/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-null.html b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-null.html new file mode 100644 index 000000000..e81a56bad --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-null.html @@ -0,0 +1,25 @@ + + +Using null in postMessage's second argument + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-undefined.html b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-undefined.html new file mode 100644 index 000000000..7d01eba7a --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-undefined.html @@ -0,0 +1,25 @@ + + +Using undefined in postMessage's second argument + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/setting-postMessage.html b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/setting-postMessage.html new file mode 100644 index 000000000..d1a3f0f5c --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/setting-postMessage.html @@ -0,0 +1,24 @@ + + +setting postMessage + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/structured-clone-imagedata.html b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/structured-clone-imagedata.html new file mode 100644 index 000000000..c0ded6a28 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/structured-clone-imagedata.html @@ -0,0 +1,30 @@ + + +structured clone of ImageData + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/structured-clone-message.html b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/structured-clone-message.html new file mode 100644 index 000000000..ba357421f --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/structured-clone-message.html @@ -0,0 +1,58 @@ + + +structured clone of message + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope/name/getting.html b/testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope/name/getting.html new file mode 100644 index 000000000..bfe81a8a9 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope/name/getting.html @@ -0,0 +1,34 @@ + + +getting name + + +
+ + + + diff --git a/testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope/name/setting.html b/testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope/name/setting.html new file mode 100644 index 000000000..39cdf7b67 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope/name/setting.html @@ -0,0 +1,25 @@ + + +setting name + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope/onconnect.html b/testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope/onconnect.html new file mode 100644 index 000000000..2ad155bf7 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope/onconnect.html @@ -0,0 +1,39 @@ + + +onconnect + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/close/incoming-message.html b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/close/incoming-message.html new file mode 100644 index 000000000..d65695632 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/close/incoming-message.html @@ -0,0 +1,29 @@ + + +close() and incoming message + + +
+ + + + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/close/sending-messages.html b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/close/sending-messages.html new file mode 100644 index 000000000..983c422cc --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/close/sending-messages.html @@ -0,0 +1,27 @@ + + +close() and sending messages + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/close/setInterval.html b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/close/setInterval.html new file mode 100644 index 000000000..1d7d178d2 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/close/setInterval.html @@ -0,0 +1,34 @@ + + +close() and setInterval + + +
+ + + + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/close/setTimeout.html b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/close/setTimeout.html new file mode 100644 index 000000000..c2fa10dfc --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/close/setTimeout.html @@ -0,0 +1,28 @@ + + +close() and setTimeout + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/helper-redirect.py b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/helper-redirect.py new file mode 100644 index 000000000..eb1599a57 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/helper-redirect.py @@ -0,0 +1,3 @@ +def main(request, response): + response.status = 302 + response.headers.append("Location", "post-location-members.js?a") diff --git a/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/members.html b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/members.html new file mode 100644 index 000000000..31ddf37a1 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/members.html @@ -0,0 +1,31 @@ + + +members of WorkerLocation + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/post-location-members.js b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/post-location-members.js new file mode 100644 index 000000000..e850b76b6 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/post-location-members.js @@ -0,0 +1,8 @@ +postMessage([location.href, + location.protocol, + location.host, + location.hostname, + location.port, + location.pathname, + location.search, + location.hash]); \ No newline at end of file diff --git a/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/redirect.html b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/redirect.html new file mode 100644 index 000000000..2fd16a4c1 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/redirect.html @@ -0,0 +1,28 @@ + + +location with a worker in separate file that redirects + + +
+ + + + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/returns-same-object.html b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/returns-same-object.html new file mode 100644 index 000000000..40559c166 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/returns-same-object.html @@ -0,0 +1,21 @@ + + +location === location + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/setting-members.html b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/setting-members.html new file mode 100644 index 000000000..d2f470ffc --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/setting-members.html @@ -0,0 +1,43 @@ + + +setting members of WorkerLocation + + +
+ + + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/worker-separate-file.html b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/worker-separate-file.html new file mode 100644 index 000000000..ac8e64dcc --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/location/worker-separate-file.html @@ -0,0 +1,28 @@ + + +location with a worker in separate file + + +
+ + + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/exception-in-onerror.html b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/exception-in-onerror.html new file mode 100644 index 000000000..4b5af71d5 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/exception-in-onerror.html @@ -0,0 +1,32 @@ + + +onerror, "not handled" with an error in the onerror function + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/handled.html b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/handled.html new file mode 100644 index 000000000..56fee8e06 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/handled.html @@ -0,0 +1,36 @@ + + +onerror, "handled" + + +
+ + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/not-handled.html b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/not-handled.html new file mode 100644 index 000000000..f6107ada4 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/not-handled.html @@ -0,0 +1,32 @@ + + +onerror, "not handled" + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/propagate-to-window-onerror.html b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/propagate-to-window-onerror.html new file mode 100644 index 000000000..b6a61e235 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/propagate-to-window-onerror.html @@ -0,0 +1,31 @@ + + +onerror, "not handled" with only window.onerror defined + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/self.html b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/self.html new file mode 100644 index 000000000..39c2c36c0 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/self.html @@ -0,0 +1,39 @@ + + +self + + +
+ + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/WindowTimers/001.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/WindowTimers/001.html new file mode 100644 index 000000000..a80897518 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/WindowTimers/001.html @@ -0,0 +1,23 @@ + + +setTimeout + + +
+ + + + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/WindowTimers/002.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/WindowTimers/002.html new file mode 100644 index 000000000..06685a905 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/WindowTimers/002.html @@ -0,0 +1,21 @@ + + +clearTimeout + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/WindowTimers/003.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/WindowTimers/003.html new file mode 100644 index 000000000..942f139fa --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/WindowTimers/003.html @@ -0,0 +1,22 @@ + + +setInterval + + +
+ + + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/WindowTimers/004.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/WindowTimers/004.html new file mode 100644 index 000000000..5548eec4a --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/WindowTimers/004.html @@ -0,0 +1,23 @@ + + +clearInterval + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/001.worker.js b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/001.worker.js new file mode 100644 index 000000000..aa86c8ef1 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/001.worker.js @@ -0,0 +1,7 @@ +importScripts("/resources/testharness.js"); + +test(function() { + importScripts(); +}); + +done(); diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/002.worker.js b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/002.worker.js new file mode 100644 index 000000000..2cecbcb53 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/002.worker.js @@ -0,0 +1,11 @@ +importScripts("/resources/testharness.js"); + +test(function() { + var ran = false; + assert_throws("SyntaxError", function() { + importScripts('data:text/javascript,ran=true','http://foo bar'); + }); + assert_false(ran, 'first argument to importScripts ran'); +}); + +done(); diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/003.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/003.html new file mode 100644 index 000000000..7ff30ae2a --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/003.html @@ -0,0 +1,28 @@ + + +importScripts running scripts + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/004.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/004.html new file mode 100644 index 000000000..2d39d3ce7 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/004.html @@ -0,0 +1,34 @@ + + +importScripts broken script + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/005.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/005.html new file mode 100644 index 000000000..f8abe14c2 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/005.html @@ -0,0 +1,30 @@ + + +importScripts separate scripts + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/006.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/006.html new file mode 100644 index 000000000..06aea9696 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/006.html @@ -0,0 +1,33 @@ + + +importScripts uncaught exception + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/007.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/007.html new file mode 100644 index 000000000..128fb1b64 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/007.html @@ -0,0 +1,25 @@ + + +postMessage in importScripts + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/008.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/008.html new file mode 100644 index 000000000..07b800ebb --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/008.html @@ -0,0 +1,23 @@ + + +variables and functions crossing importScripts boundary + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/009.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/009.html new file mode 100644 index 000000000..95d3839dc --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/009.html @@ -0,0 +1,29 @@ + + +variables and functions crossing importScripts boundary, take 2 + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/010.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/010.html new file mode 100644 index 000000000..9c76e7d4d --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/010.html @@ -0,0 +1,34 @@ + + +importScripts(undefined) + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/011.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/011.html new file mode 100644 index 000000000..46499318f --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/011.html @@ -0,0 +1,34 @@ + + +importScripts(null) + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/012.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/012.html new file mode 100644 index 000000000..f7622bdc9 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/012.html @@ -0,0 +1,34 @@ + + +importScripts(1) + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/1 b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/1 new file mode 100644 index 000000000..18cea4ff0 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/1 @@ -0,0 +1 @@ +var got = '1'; \ No newline at end of file diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/null b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/null new file mode 100644 index 000000000..8e54b66c5 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/null @@ -0,0 +1 @@ +var got = 'null'; \ No newline at end of file diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/undefined b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/undefined new file mode 100644 index 000000000..f99ba4be7 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/importScripts/undefined @@ -0,0 +1 @@ +var got = 'undefined'; \ No newline at end of file diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/002.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/002.html new file mode 100644 index 000000000..d3aa2ec65 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/002.html @@ -0,0 +1,21 @@ + + +navigator.appName + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/003.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/003.html new file mode 100644 index 000000000..a2e5c9487 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/003.html @@ -0,0 +1,21 @@ + + +navigator.appVersion + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/004.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/004.html new file mode 100644 index 000000000..2231c4ab8 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/004.html @@ -0,0 +1,21 @@ + + +navigator.platform + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/005.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/005.html new file mode 100644 index 000000000..b3d99588f --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/005.html @@ -0,0 +1,21 @@ + + +navigator.userAgent + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/006.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/006.html new file mode 100644 index 000000000..c027d630d --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/006.html @@ -0,0 +1,21 @@ + + +navigator.onLine + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/007.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/007.html new file mode 100644 index 000000000..a6afc5637 --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/007.html @@ -0,0 +1,30 @@ + + +readonlyness of members of Navigator + + +
+ + + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/language.html b/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/language.html new file mode 100644 index 000000000..f1aa446cb --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/language.html @@ -0,0 +1,21 @@ + + +navigator.language + + +
+ + diff --git a/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/window-only.worker.js b/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/window-only.worker.js new file mode 100644 index 000000000..7095281ec --- /dev/null +++ b/testing/web-platform/tests/workers/interfaces/WorkerUtils/navigator/window-only.worker.js @@ -0,0 +1,22 @@ +importScripts("/resources/testharness.js"); + +var properties = [ + "appCodeName", + "product", + "productSub", + "vendor", + "vendorSub", + + // Only exist in Window scopes if navigator compatibility mode is Gecko; + // never exist in workers. + "taintEnabled", + "oscpu", +]; + +properties.forEach(function(property) { + test(function() { + assert_false(property in navigator); + }, "NavigatorID properties exposed only for Window: " + property); +}); + +done(); diff --git a/testing/web-platform/tests/workers/nested_worker.worker.js b/testing/web-platform/tests/workers/nested_worker.worker.js new file mode 100644 index 000000000..8848fa216 --- /dev/null +++ b/testing/web-platform/tests/workers/nested_worker.worker.js @@ -0,0 +1,11 @@ +importScripts("/resources/testharness.js"); + +async_test(function() { + var worker1 = new Worker("support/WorkerBasic.js"); + worker1.postMessage("ping"); + worker1.onmessage = this.step_func_done(function(evt) { + assert_equals(evt.data, "Pass"); + worker1.terminate(); + done(); + }); +}, "Nested worker"); diff --git a/testing/web-platform/tests/workers/non-automated/application-cache-dedicated.html b/testing/web-platform/tests/workers/non-automated/application-cache-dedicated.html new file mode 100644 index 000000000..704ecbcd7 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/application-cache-dedicated.html @@ -0,0 +1,21 @@ + + +cache manifest +

Script did not run.

+

To run this test again, delete private data and then load this test again.

+ diff --git a/testing/web-platform/tests/workers/non-automated/application-cache-dedicated.js b/testing/web-platform/tests/workers/non-automated/application-cache-dedicated.js new file mode 100644 index 000000000..2318c2e26 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/application-cache-dedicated.js @@ -0,0 +1 @@ +postMessage(1); \ No newline at end of file diff --git a/testing/web-platform/tests/workers/non-automated/cache.manifest b/testing/web-platform/tests/workers/non-automated/cache.manifest new file mode 100644 index 000000000..8d80e03b2 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/cache.manifest @@ -0,0 +1,3 @@ +CACHE MANIFEST +application-cache-dedicated.html +application-cache-dedicated.js diff --git a/testing/web-platform/tests/workers/non-automated/infinite-nested.html b/testing/web-platform/tests/workers/non-automated/infinite-nested.html new file mode 100644 index 000000000..3ff3edb35 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/infinite-nested.html @@ -0,0 +1,12 @@ + +infinite nested workers +

There number below should be increasing (ideally never-ending).

+
0
+ \ No newline at end of file diff --git a/testing/web-platform/tests/workers/non-automated/infinite-nested.js b/testing/web-platform/tests/workers/non-automated/infinite-nested.js new file mode 100644 index 000000000..137dd0a2e --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/infinite-nested.js @@ -0,0 +1,5 @@ +postMessage(1); +var w = new Worker('infinite-nested.js'); +w.onmessage = function(e) { + postMessage(e.data); +} \ No newline at end of file diff --git a/testing/web-platform/tests/workers/non-automated/infinite-sibling-and-nested.html b/testing/web-platform/tests/workers/non-automated/infinite-sibling-and-nested.html new file mode 100644 index 000000000..463546cc9 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/infinite-sibling-and-nested.html @@ -0,0 +1,12 @@ + +infinite sibling and nested workers +

The number below should be increasing (ideally never-ending).

+
0
+ diff --git a/testing/web-platform/tests/workers/non-automated/infinite-sibling-and-nested.js b/testing/web-platform/tests/workers/non-automated/infinite-sibling-and-nested.js new file mode 100644 index 000000000..cf7b794a4 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/infinite-sibling-and-nested.js @@ -0,0 +1,8 @@ +function createWorker() { + var worker = new Worker('infinite-nested.js?' + Math.random()); + worker.onmessage = function(e) { + postMessage(e.data); + createWorker(); + } +} +createWorker(); \ No newline at end of file diff --git a/testing/web-platform/tests/workers/non-automated/infinite-sibling.html b/testing/web-platform/tests/workers/non-automated/infinite-sibling.html new file mode 100644 index 000000000..edcb8d707 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/infinite-sibling.html @@ -0,0 +1,12 @@ + +infinite sibling workers +

The number below should be increasing (ideally never-ending).

+
0
+ diff --git a/testing/web-platform/tests/workers/non-automated/infinite-sibling.js b/testing/web-platform/tests/workers/non-automated/infinite-sibling.js new file mode 100644 index 000000000..6424f7009 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/infinite-sibling.js @@ -0,0 +1,8 @@ +function createWorker() { + var worker = new Worker('post-a-1.js?' + Math.random()); + worker.onmessage = function(e) { + postMessage(e.data); + createWorker(); + } +} +createWorker(); \ No newline at end of file diff --git a/testing/web-platform/tests/workers/non-automated/navigator-onLine.html b/testing/web-platform/tests/workers/non-automated/navigator-onLine.html new file mode 100644 index 000000000..d71aeaf0a --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/navigator-onLine.html @@ -0,0 +1,46 @@ + + +navigator.onLine in dedicated worker +
Log:
+
+ +

As you go online and offline, the log should be filled with the correct status of navigator.onLine.

+

+ diff --git a/testing/web-platform/tests/workers/non-automated/post-a-1.js b/testing/web-platform/tests/workers/non-automated/post-a-1.js new file mode 100644 index 000000000..2318c2e26 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/post-a-1.js @@ -0,0 +1 @@ +postMessage(1); \ No newline at end of file diff --git a/testing/web-platform/tests/workers/postMessage_DataCloneErr.htm b/testing/web-platform/tests/workers/postMessage_DataCloneErr.htm new file mode 100644 index 000000000..24093ce4e --- /dev/null +++ b/testing/web-platform/tests/workers/postMessage_DataCloneErr.htm @@ -0,0 +1,13 @@ + + postMessage() with WorkerNavigator + + +
+ diff --git a/testing/web-platform/tests/workers/postMessage_clone_port.htm b/testing/web-platform/tests/workers/postMessage_clone_port.htm new file mode 100644 index 000000000..b1d7b84e3 --- /dev/null +++ b/testing/web-platform/tests/workers/postMessage_clone_port.htm @@ -0,0 +1,22 @@ + + postMessage(): clone a port + + +
+ diff --git a/testing/web-platform/tests/workers/postMessage_clone_port_error.htm b/testing/web-platform/tests/workers/postMessage_clone_port_error.htm new file mode 100644 index 000000000..30012962d --- /dev/null +++ b/testing/web-platform/tests/workers/postMessage_clone_port_error.htm @@ -0,0 +1,14 @@ + + postMessage(): cloning source port + + +
+ diff --git a/testing/web-platform/tests/workers/postMessage_event_properties.htm b/testing/web-platform/tests/workers/postMessage_event_properties.htm new file mode 100644 index 000000000..8122413de --- /dev/null +++ b/testing/web-platform/tests/workers/postMessage_event_properties.htm @@ -0,0 +1,24 @@ + + postMessage(): MessageEvent properties + + +
+ diff --git a/testing/web-platform/tests/workers/postMessage_ports_readonly_array.htm b/testing/web-platform/tests/workers/postMessage_ports_readonly_array.htm new file mode 100644 index 000000000..5e2b9054a --- /dev/null +++ b/testing/web-platform/tests/workers/postMessage_ports_readonly_array.htm @@ -0,0 +1,20 @@ + + postMessage(): read-only ports array + + +
+ diff --git a/testing/web-platform/tests/workers/postMessage_target_source.htm b/testing/web-platform/tests/workers/postMessage_target_source.htm new file mode 100644 index 000000000..7d684916d --- /dev/null +++ b/testing/web-platform/tests/workers/postMessage_target_source.htm @@ -0,0 +1,18 @@ + + postMessage(): target port and source port + + +
+ diff --git a/testing/web-platform/tests/workers/semantics/encodings/001.html b/testing/web-platform/tests/workers/semantics/encodings/001.html new file mode 100644 index 000000000..0ebec0b03 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/001.html @@ -0,0 +1,21 @@ + + +encoding, dedicated worker + + +
+ + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/encodings/001.html.headers b/testing/web-platform/tests/workers/semantics/encodings/001.html.headers new file mode 100644 index 000000000..2340a89c9 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/001.html.headers @@ -0,0 +1 @@ +Content-Type: text/html; charset=windows-1252 diff --git a/testing/web-platform/tests/workers/semantics/encodings/002.html b/testing/web-platform/tests/workers/semantics/encodings/002.html new file mode 100644 index 000000000..fdcc4f0a2 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/002.html @@ -0,0 +1,23 @@ + + +encoding, shared worker + + +
+ + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/encodings/002.html.headers b/testing/web-platform/tests/workers/semantics/encodings/002.html.headers new file mode 100644 index 000000000..2340a89c9 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/002.html.headers @@ -0,0 +1 @@ +Content-Type: text/html; charset=windows-1252 diff --git a/testing/web-platform/tests/workers/semantics/encodings/003-1.py b/testing/web-platform/tests/workers/semantics/encodings/003-1.py new file mode 100644 index 000000000..1e899aac2 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/003-1.py @@ -0,0 +1,4 @@ + # -*- coding: utf-8 -*- + +def main(request, response): + return "PASS" if request.GET.first('x') == 'Ã¥' else "FAIL" diff --git a/testing/web-platform/tests/workers/semantics/encodings/003.html b/testing/web-platform/tests/workers/semantics/encodings/003.html new file mode 100644 index 000000000..a0f964c3c --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/003.html @@ -0,0 +1,26 @@ + + +URL encoding, dedicated worker + + +
+ + diff --git a/testing/web-platform/tests/workers/semantics/encodings/004.html b/testing/web-platform/tests/workers/semantics/encodings/004.html new file mode 100644 index 000000000..bb1442633 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/004.html @@ -0,0 +1,27 @@ + + +URL encoding, shared worker + + +
+ + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/encodings/004.worker.js b/testing/web-platform/tests/workers/semantics/encodings/004.worker.js new file mode 100644 index 000000000..28489a572 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/004.worker.js @@ -0,0 +1,5 @@ +importScripts("/resources/testharness.js"); +test(function() { + assert_equals("ÿ", "\ufffd"); +}, "Decoding invalid utf-8"); +done(); diff --git a/testing/web-platform/tests/workers/semantics/interface-objects/001.worker.js b/testing/web-platform/tests/workers/semantics/interface-objects/001.worker.js new file mode 100644 index 000000000..23df42036 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/interface-objects/001.worker.js @@ -0,0 +1,79 @@ +importScripts("/resources/testharness.js"); +var expected = [ + // https://html.spec.whatwg.org/ + "WorkerGlobalScope", + "DedicatedWorkerGlobalScope", + "Worker", + "SharedWorker", + "MessagePort", + "MessageEvent", + "WorkerNavigator", + "MessageChannel", + "WorkerLocation", + "ImageData", + "ImageBitmap", + "CanvasPath", + "Path2D", + "PromiseRejectionEvent", + "EventSource", + "WebSocket", + "CloseEvent", + "BroadcastChannel", + // https://tc39.github.io/ecma262/ + "ArrayBuffer", + "Int8Array", + "Uint8Array", + "Uint8ClampedArray", + "Int16Array", + "Uint16Array", + "Int32Array", + "Uint32Array", + "Float32Array", + "Float64Array", + "DataView", + // https://xhr.spec.whatwg.org/ + "XMLHttpRequestEventTarget", + "XMLHttpRequestUpload", + "XMLHttpRequest", + "ProgressEvent", + "FormData", + // https://url.spec.whatwg.org/ + "URL", + "URLSearchParams", + // https://w3c.github.io/FileAPI/ + "File", + "Blob", + "FileList", + "FileReader", + "FileReaderSync", + // https://dom.spec.whatwg.org/ + "EventTarget", + "ErrorEvent", + "Event", + "CustomEvent", + // http://heycam.github.io/webidl/ + "DOMException", + // https://streams.spec.whatwg.org/ + "ReadableStream", + "WritableStream", + "ByteLengthQueuingStrategy", + "CountQueuingStrategy", + // http://w3c.github.io/IndexedDB/ + "IDBRequest", + "IDBOpenDBRequest", + "IDBVersionChangeEvent", + "IDBFactory", + "IDBDatabase", + "IDBObjectStore", + "IDBIndex", + "IDBKeyRange", + "IDBCursor", + "IDBCursorWithValue", + "IDBTransaction", +]; +for (var i = 0; i < expected.length; ++i) { + test(function () { + assert_own_property(self, expected[i]); + }, "The " + expected[i] + " interface object should be exposed."); +} +done(); diff --git a/testing/web-platform/tests/workers/semantics/interface-objects/002.worker.js b/testing/web-platform/tests/workers/semantics/interface-objects/002.worker.js new file mode 100644 index 000000000..0f514988b --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/interface-objects/002.worker.js @@ -0,0 +1,49 @@ +importScripts("/resources/testharness.js"); +var unexpected = [ + // https://html.spec.whatwg.org/ + "SharedWorkerGlobalScope", + "AbstractView", + "AbstractWorker", + "ApplicationCache", + "Location", + "Navigator", + "Audio", + "HTMLCanvasElement", + "Path", + "TextMetrics", + "CanvasProxy", + "CanvasRenderingContext2D", + "DrawingStyle", + "CanvasGradient", + "CanvasPattern", + "PopStateEvent", + "HashChangeEvent", + "PageTransitionEvent", + // https://dom.spec.whatwg.org/ + "DOMImplementation", + // https://streams.spec.whatwg.org/ + "ReadableStreamDefaultReader", + "ReadableStreamBYOBReader", + "ReadableStreamDefaultController", + "ReadableByteStreamController", + "WritableStreamDefaultWriter", + "WritableStreamDefaultController", + // http://w3c.github.io/IndexedDB/ + "IDBEnvironment", + // https://www.w3.org/TR/2010/NOTE-webdatabase-20101118/ + "Database", + // https://w3c.github.io/uievents/ + "UIEvent", + "FocusEvent", + "MouseEvent", + "WheelEvent", + "InputEvent", + "KeyboardEvent", + "CompositionEvent", +]; +for (var i = 0; i < unexpected.length; ++i) { + test(function () { + assert_false(unexpected[i] in self); + }, "The " + unexpected[i] + " interface object should not be exposed."); +} +done(); diff --git a/testing/web-platform/tests/workers/semantics/interface-objects/003.html b/testing/web-platform/tests/workers/semantics/interface-objects/003.html new file mode 100644 index 000000000..5277825db --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/interface-objects/003.html @@ -0,0 +1,106 @@ + + +available interface objects in shared worker + + +
+ + + diff --git a/testing/web-platform/tests/workers/semantics/interface-objects/004.html b/testing/web-platform/tests/workers/semantics/interface-objects/004.html new file mode 100644 index 000000000..2e4387ede --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/interface-objects/004.html @@ -0,0 +1,73 @@ + + +unavailable interface objects in shared worker + + +
+ + + diff --git a/testing/web-platform/tests/workers/semantics/multiple-workers/001.html b/testing/web-platform/tests/workers/semantics/multiple-workers/001.html new file mode 100644 index 000000000..82ddcc3c1 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/001.html @@ -0,0 +1,41 @@ + + +dedicated and shared worker in same page + + +
+ + + diff --git a/testing/web-platform/tests/workers/semantics/multiple-workers/002.html b/testing/web-platform/tests/workers/semantics/multiple-workers/002.html new file mode 100644 index 000000000..9ab1f54f4 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/002.html @@ -0,0 +1,28 @@ + + +creating 3 sibling dedicated workers + + +
+ + diff --git a/testing/web-platform/tests/workers/semantics/multiple-workers/003.html b/testing/web-platform/tests/workers/semantics/multiple-workers/003.html new file mode 100644 index 000000000..85c688bc0 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/003.html @@ -0,0 +1,34 @@ + + +creating 3 nested dedicated workers + + +
+ + diff --git a/testing/web-platform/tests/workers/semantics/multiple-workers/004-1.html b/testing/web-platform/tests/workers/semantics/multiple-workers/004-1.html new file mode 100644 index 000000000..eac038c5b --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/004-1.html @@ -0,0 +1,7 @@ + + + diff --git a/testing/web-platform/tests/workers/semantics/multiple-workers/004-2.js b/testing/web-platform/tests/workers/semantics/multiple-workers/004-2.js new file mode 100644 index 000000000..e59cd6927 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/004-2.js @@ -0,0 +1,6 @@ +var port; +onconnect = function(e) { + if (!port) + port = e.ports[0]; + port.postMessage(1); +} \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/multiple-workers/004.html b/testing/web-platform/tests/workers/semantics/multiple-workers/004.html new file mode 100644 index 000000000..c47337008 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/004.html @@ -0,0 +1,34 @@ + +shared worker with multiple documents + + +
+ + + diff --git a/testing/web-platform/tests/workers/semantics/multiple-workers/005.html b/testing/web-platform/tests/workers/semantics/multiple-workers/005.html new file mode 100644 index 000000000..289c25ec6 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/005.html @@ -0,0 +1,37 @@ + + +dedicated worker in shared worker in dedicated worker + + +
+ + diff --git a/testing/web-platform/tests/workers/semantics/multiple-workers/006-1.js b/testing/web-platform/tests/workers/semantics/multiple-workers/006-1.js new file mode 100644 index 000000000..6c1ed9323 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/006-1.js @@ -0,0 +1,3 @@ + onconnect = function(e) { + e.ports[0].postMessage('3'); + } \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/multiple-workers/006.html b/testing/web-platform/tests/workers/semantics/multiple-workers/006.html new file mode 100644 index 000000000..ef2124256 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/006.html @@ -0,0 +1,35 @@ + + +shared worker in dedicated worker in shared worker + + +
+ + diff --git a/testing/web-platform/tests/workers/semantics/multiple-workers/007.html b/testing/web-platform/tests/workers/semantics/multiple-workers/007.html new file mode 100644 index 000000000..e99345073 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/007.html @@ -0,0 +1,39 @@ + + +shared worker in dedicated worker in shared worker + + +
+ + diff --git a/testing/web-platform/tests/workers/semantics/multiple-workers/008-1.html b/testing/web-platform/tests/workers/semantics/multiple-workers/008-1.html new file mode 100644 index 000000000..82a8a3835 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/008-1.html @@ -0,0 +1,8 @@ + +008-1 + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/multiple-workers/008.html b/testing/web-platform/tests/workers/semantics/multiple-workers/008.html new file mode 100644 index 000000000..fbb41e0d0 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/008.html @@ -0,0 +1,31 @@ + + +messagechannel in shared worker + + +
+ + + diff --git a/testing/web-platform/tests/workers/semantics/navigation/001-1.html b/testing/web-platform/tests/workers/semantics/navigation/001-1.html new file mode 100644 index 000000000..9d7ecee17 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/navigation/001-1.html @@ -0,0 +1,23 @@ + + +001-1 + +link + + diff --git a/testing/web-platform/tests/workers/semantics/navigation/001.html b/testing/web-platform/tests/workers/semantics/navigation/001.html new file mode 100644 index 000000000..658df0624 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/navigation/001.html @@ -0,0 +1,36 @@ + + +navigating + + +
+ + + + + diff --git a/testing/web-platform/tests/workers/semantics/navigation/002.html b/testing/web-platform/tests/workers/semantics/navigation/002.html new file mode 100644 index 000000000..c0d5eb5c0 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/navigation/002.html @@ -0,0 +1,36 @@ + + +navigating 2 + + +
+ + + + + diff --git a/testing/web-platform/tests/workers/semantics/reporting-errors/001.html b/testing/web-platform/tests/workers/semantics/reporting-errors/001.html new file mode 100644 index 000000000..adba81f63 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/reporting-errors/001.html @@ -0,0 +1,53 @@ + + +shared worker, not handled + + +
+ + diff --git a/testing/web-platform/tests/workers/semantics/reporting-errors/002.html b/testing/web-platform/tests/workers/semantics/reporting-errors/002.html new file mode 100644 index 000000000..c2cd377b4 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/reporting-errors/002.html @@ -0,0 +1,59 @@ + + +shared worker, addEventListener + + +
+ + diff --git a/testing/web-platform/tests/workers/semantics/reporting-errors/003.html b/testing/web-platform/tests/workers/semantics/reporting-errors/003.html new file mode 100644 index 000000000..1b01c7caf --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/reporting-errors/003.html @@ -0,0 +1,39 @@ + + +shared worker, no error event on worker or port + + +
+ + diff --git a/testing/web-platform/tests/workers/semantics/reporting-errors/004-1.html b/testing/web-platform/tests/workers/semantics/reporting-errors/004-1.html new file mode 100644 index 000000000..676c21e60 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/reporting-errors/004-1.html @@ -0,0 +1,18 @@ + + diff --git a/testing/web-platform/tests/workers/semantics/reporting-errors/004.html b/testing/web-platform/tests/workers/semantics/reporting-errors/004.html new file mode 100644 index 000000000..1dd1eb3b5 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/reporting-errors/004.html @@ -0,0 +1,39 @@ + + +shared worker in two documents and window.onerror + + +
+ + diff --git a/testing/web-platform/tests/workers/semantics/run-a-worker/001.html b/testing/web-platform/tests/workers/semantics/run-a-worker/001.html new file mode 100644 index 000000000..aa0fc67ef --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/run-a-worker/001.html @@ -0,0 +1,22 @@ + + +worker global scope, dedicated worker + + +
+ + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/run-a-worker/002.html b/testing/web-platform/tests/workers/semantics/run-a-worker/002.html new file mode 100644 index 000000000..3617ad727 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/run-a-worker/002.html @@ -0,0 +1,24 @@ + + +worker global scope, shared worker + + +
+ + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/run-a-worker/003.html b/testing/web-platform/tests/workers/semantics/run-a-worker/003.html new file mode 100644 index 000000000..8c2f07ee7 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/run-a-worker/003.html @@ -0,0 +1,21 @@ + +handling for 404 response + + +
+ diff --git a/testing/web-platform/tests/workers/semantics/structured-clone/common.js b/testing/web-platform/tests/workers/semantics/structured-clone/common.js new file mode 100644 index 000000000..56c2a3004 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/structured-clone/common.js @@ -0,0 +1,596 @@ +function createWorker(msg) { + // `type` is defined in the test case itself + if (type == 'dedicated') + return new Worker('dedicated.js#'+encodeURIComponent(msg)); + else if (type == 'shared') + return (new SharedWorker('shared.js#'+encodeURIComponent(msg))).port; + else + assert_unreached('invalid or missing `type`'); +} + +function check(msg, input, callback, test_obj) { + if (!test_obj) + test_obj = async_test(msg); + test_obj.step(function() { + var w = createWorker(msg); + if (typeof input === 'function') + input = this.step(input); + w.postMessage(input); + w.onmessage = this.step_func(function(ev) { callback(ev.data, input, this); }); + }); +} + +function compare_primitive(actual, input, test_obj) { + assert_equals(actual, input); + if (test_obj) + test_obj.done(); +} +function compare_Array(callback, callback_is_async) { + return function(actual, input, test_obj) { + if (typeof actual === 'string') + assert_unreached(actual); + assert_true(actual instanceof Array, 'instanceof Array'); + assert_not_equals(actual, input); + assert_equals(actual.length, input.length, 'length'); + callback(actual, input); + if (test_obj && !callback_is_async) + test_obj.done(); + } +} + +function compare_Object(callback, callback_is_async) { + return function(actual, input, test_obj) { + if (typeof actual === 'string') + assert_unreached(actual); + assert_true(actual instanceof Object, 'instanceof Object'); + assert_false(actual instanceof Array, 'instanceof Array'); + assert_not_equals(actual, input); + callback(actual, input); + if (test_obj && !callback_is_async) + test_obj.done(); + } +} + +function enumerate_props(compare_func, test_obj) { + return function(actual, input) { + for (var x in input) { + compare_func(actual[x], input[x], test_obj); + } + }; +} + +check('primitive undefined', undefined, compare_primitive); +check('primitive null', null, compare_primitive); +check('primitive true', true, compare_primitive); +check('primitive false', false, compare_primitive); +check('primitive string, empty string', '', compare_primitive); +check('primitive string, lone high surrogate', '\uD800', compare_primitive); +check('primitive string, lone low surrogate', '\uDC00', compare_primitive); +check('primitive string, NUL', '\u0000', compare_primitive); +check('primitive string, astral character', '\uDBFF\uDFFD', compare_primitive); +check('primitive number, 0.2', 0.2, compare_primitive); +check('primitive number, 0', 0, compare_primitive); +check('primitive number, -0', -0, compare_primitive); +check('primitive number, NaN', NaN, compare_primitive); +check('primitive number, Infinity', Infinity, compare_primitive); +check('primitive number, -Infinity', -Infinity, compare_primitive); +check('primitive number, 9007199254740992', 9007199254740992, compare_primitive); +check('primitive number, -9007199254740992', -9007199254740992, compare_primitive); +check('primitive number, 9007199254740994', 9007199254740994, compare_primitive); +check('primitive number, -9007199254740994', -9007199254740994, compare_primitive); + +check('Array primitives', [undefined, + null, + true, + false, + '', + '\uD800', + '\uDC00', + '\u0000', + '\uDBFF\uDFFD', + 0.2, + 0, + -0, + NaN, + Infinity, + -Infinity, + 9007199254740992, + -9007199254740992, + 9007199254740994, + -9007199254740994], compare_Array(enumerate_props(compare_primitive))); +check('Object primitives', {'undefined':undefined, + 'null':null, + 'true':true, + 'false':false, + 'empty':'', + 'high surrogate':'\uD800', + 'low surrogate':'\uDC00', + 'nul':'\u0000', + 'astral':'\uDBFF\uDFFD', + '0.2':0.2, + '0':0, + '-0':-0, + 'NaN':NaN, + 'Infinity':Infinity, + '-Infinity':-Infinity, + '9007199254740992':9007199254740992, + '-9007199254740992':-9007199254740992, + '9007199254740994':9007199254740994, + '-9007199254740994':-9007199254740994}, compare_Object(enumerate_props(compare_primitive))); + +function compare_Boolean(actual, input, test_obj) { + if (typeof actual === 'string') + assert_unreached(actual); + assert_true(actual instanceof Boolean, 'instanceof Boolean'); + assert_equals(String(actual), String(input), 'converted to primitive'); + assert_not_equals(actual, input); + if (test_obj) + test_obj.done(); +} +check('Boolean true', new Boolean(true), compare_Boolean); +check('Boolean false', new Boolean(false), compare_Boolean); +check('Array Boolean objects', [new Boolean(true), new Boolean(false)], compare_Array(enumerate_props(compare_Boolean))); +check('Object Boolean objects', {'true':new Boolean(true), 'false':new Boolean(false)}, compare_Object(enumerate_props(compare_Boolean))); + +function compare_obj(what) { + var Type = window[what]; + return function(actual, input, test_obj) { + if (typeof actual === 'string') + assert_unreached(actual); + assert_true(actual instanceof Type, 'instanceof '+what); + assert_equals(Type(actual), Type(input), 'converted to primitive'); + assert_not_equals(actual, input); + if (test_obj) + test_obj.done(); + }; +} +check('String empty string', new String(''), compare_obj('String')); +check('String lone high surrogate', new String('\uD800'), compare_obj('String')); +check('String lone low surrogate', new String('\uDC00'), compare_obj('String')); +check('String NUL', new String('\u0000'), compare_obj('String')); +check('String astral character', new String('\uDBFF\uDFFD'), compare_obj('String')); +check('Array String objects', [new String(''), + new String('\uD800'), + new String('\uDC00'), + new String('\u0000'), + new String('\uDBFF\uDFFD')], compare_Array(enumerate_props(compare_obj('String')))); +check('Object String objects', {'empty':new String(''), + 'high surrogate':new String('\uD800'), + 'low surrogate':new String('\uDC00'), + 'nul':new String('\u0000'), + 'astral':new String('\uDBFF\uDFFD')}, compare_Object(enumerate_props(compare_obj('String')))); + +check('Number 0.2', new Number(0.2), compare_obj('Number')); +check('Number 0', new Number(0), compare_obj('Number')); +check('Number -0', new Number(-0), compare_obj('Number')); +check('Number NaN', new Number(NaN), compare_obj('Number')); +check('Number Infinity', new Number(Infinity), compare_obj('Number')); +check('Number -Infinity', new Number(-Infinity), compare_obj('Number')); +check('Number 9007199254740992', new Number(9007199254740992), compare_obj('Number')); +check('Number -9007199254740992', new Number(-9007199254740992), compare_obj('Number')); +check('Number 9007199254740994', new Number(9007199254740994), compare_obj('Number')); +check('Number -9007199254740994', new Number(-9007199254740994), compare_obj('Number')); +check('Array Number objects', [new Number(0.2), + new Number(0), + new Number(-0), + new Number(NaN), + new Number(Infinity), + new Number(-Infinity), + new Number(9007199254740992), + new Number(-9007199254740992), + new Number(9007199254740994), + new Number(-9007199254740994)], compare_Array(enumerate_props(compare_obj('Number')))); +check('Object Number objects', {'0.2':new Number(0.2), + '0':new Number(0), + '-0':new Number(-0), + 'NaN':new Number(NaN), + 'Infinity':new Number(Infinity), + '-Infinity':new Number(-Infinity), + '9007199254740992':new Number(9007199254740992), + '-9007199254740992':new Number(-9007199254740992), + '9007199254740994':new Number(9007199254740994), + '-9007199254740994':new Number(-9007199254740994)}, compare_Object(enumerate_props(compare_obj('Number')))); + +function compare_Date(actual, input, test_obj) { + if (typeof actual === 'string') + assert_unreached(actual); + assert_true(actual instanceof Date, 'instanceof Date'); + assert_equals(Number(actual), Number(input), 'converted to primitive'); + assert_not_equals(actual, input); + if (test_obj) + test_obj.done(); +} +check('Date 0', new Date(0), compare_Date); +check('Date -0', new Date(-0), compare_Date); +check('Date -8.64e15', new Date(-8.64e15), compare_Date); +check('Date 8.64e15', new Date(8.64e15), compare_Date); +check('Array Date objects', [new Date(0), + new Date(-0), + new Date(-8.64e15), + new Date(8.64e15)], compare_Array(enumerate_props(compare_Date))); +check('Object Date objects', {'0':new Date(0), + '-0':new Date(-0), + '-8.64e15':new Date(-8.64e15), + '8.64e15':new Date(8.64e15)}, compare_Object(enumerate_props(compare_Date))); + +function compare_RegExp(expected_source) { + // XXX ES6 spec doesn't define exact serialization for `source` (it allows several ways to escape) + return function(actual, input, test_obj) { + if (typeof actual === 'string') + assert_unreached(actual); + assert_true(actual instanceof RegExp, 'instanceof RegExp'); + assert_equals(actual.global, input.global, 'global'); + assert_equals(actual.ignoreCase, input.ignoreCase, 'ignoreCase'); + assert_equals(actual.multiline, input.multiline, 'multiline'); + assert_equals(actual.source, expected_source, 'source'); + assert_equals(actual.sticky, input.sticky, 'sticky'); + assert_equals(actual.unicode, input.unicode, 'unicode'); + assert_equals(actual.lastIndex, 0, 'lastIndex'); + assert_not_equals(actual, input); + if (test_obj) + test_obj.done(); + } +} +function func_RegExp_flags_lastIndex() { + var r = /foo/gim; + r.lastIndex = 2; + return r; +} +function func_RegExp_sticky() { + return new RegExp('foo', 'y'); +} +function func_RegExp_unicode() { + return new RegExp('foo', 'u'); +} +check('RegExp flags and lastIndex', func_RegExp_flags_lastIndex, compare_RegExp('foo')); +check('RegExp sticky flag', func_RegExp_sticky, compare_RegExp('foo')); +check('RegExp unicode flag', func_RegExp_unicode, compare_RegExp('foo')); +check('RegExp empty', new RegExp(''), compare_RegExp('(?:)')); +check('RegExp slash', new RegExp('/'), compare_RegExp('\\/')); +check('RegExp new line', new RegExp('\n'), compare_RegExp('\\n')); +check('Array RegExp object, RegExp flags and lastIndex', [func_RegExp_flags_lastIndex()], compare_Array(enumerate_props(compare_RegExp('foo')))); +check('Array RegExp object, RegExp sticky flag', function() { return [func_RegExp_sticky()]; }, compare_Array(enumerate_props(compare_RegExp('foo')))); +check('Array RegExp object, RegExp unicode flag', function() { return [func_RegExp_unicode()]; }, compare_Array(enumerate_props(compare_RegExp('foo')))); +check('Array RegExp object, RegExp empty', [new RegExp('')], compare_Array(enumerate_props(compare_RegExp('(?:)')))); +check('Array RegExp object, RegExp slash', [new RegExp('/')], compare_Array(enumerate_props(compare_RegExp('\\/')))); +check('Array RegExp object, RegExp new line', [new RegExp('\n')], compare_Array(enumerate_props(compare_RegExp('\\n')))); +check('Object RegExp object, RegExp flags and lastIndex', {'x':func_RegExp_flags_lastIndex()}, compare_Object(enumerate_props(compare_RegExp('foo')))); +check('Object RegExp object, RegExp sticky flag', function() { return {'x':func_RegExp_sticky()}; }, compare_Object(enumerate_props(compare_RegExp('foo')))); +check('Object RegExp object, RegExp unicode flag', function() { return {'x':func_RegExp_unicode()}; }, compare_Object(enumerate_props(compare_RegExp('foo')))); +check('Object RegExp object, RegExp empty', {'x':new RegExp('')}, compare_Object(enumerate_props(compare_RegExp('(?:)')))); +check('Object RegExp object, RegExp slash', {'x':new RegExp('/')}, compare_Object(enumerate_props(compare_RegExp('\\/')))); +check('Object RegExp object, RegExp new line', {'x':new RegExp('\n')}, compare_Object(enumerate_props(compare_RegExp('\\n')))); + +function compare_Blob(actual, input, test_obj, expect_File) { + if (typeof actual === 'string') + assert_unreached(actual); + assert_true(actual instanceof Blob, 'instanceof Blob'); + if (!expect_File) + assert_false(actual instanceof File, 'instanceof File'); + assert_equals(actual.size, input.size, 'size'); + assert_equals(actual.type, input.type, 'type'); + assert_not_equals(actual, input); + var ev_reader = new FileReader(); + var input_reader = new FileReader(); + var read_count = 0; + var read_done = test_obj.step_func(function() { + read_count++; + if (read_count == 2) { + var ev_result = ev_reader.result; + var input_result = input_reader.result; + assert_equals(ev_result.byteLength, input_result.byteLength, 'byteLength'); + var ev_view = new DataView(ev_result); + var input_view = new DataView(input_result); + for (var i = 0; i < ev_result.byteLength; ++i) { + assert_equals(ev_view.getUint8(i), input_view.getUint8(i), 'getUint8('+i+')'); + } + if (test_obj) + test_obj.done(); + } + }); + var read_error = test_obj.step_func(function() { assert_unreached('FileReader error'); }); + ev_reader.readAsArrayBuffer(actual); + ev_reader.onload = read_done; + ev_reader.onabort = ev_reader.onerror = read_error; + input_reader.readAsArrayBuffer(input); + input_reader.onload = read_done; + input_reader.onabort = input_reader.onerror = read_error; +} +function func_Blob_basic() { + return new Blob(['foo'], {type:'text/x-bar'}); +} +check('Blob basic', func_Blob_basic, compare_Blob); + +function b(str) { + return parseInt(str, 2); +} +function encode_cesu8(codeunits) { + // http://www.unicode.org/reports/tr26/ section 2.2 + // only the 3-byte form is supported + var rv = []; + codeunits.forEach(function(codeunit) { + rv.push(b('11100000') + ((codeunit & b('1111000000000000')) >> 12)); + rv.push(b('10000000') + ((codeunit & b('0000111111000000')) >> 6)); + rv.push(b('10000000') + (codeunit & b('0000000000111111'))); + }); + return rv; +} +function func_Blob_bytes(arr) { + return function() { + var buffer = new ArrayBuffer(arr.length); + var view = new DataView(buffer); + for (var i = 0; i < arr.length; ++i) { + view.setUint8(i, arr[i]); + } + return new Blob([view]); + }; +} +check('Blob unpaired high surrogate (invalid utf-8)', func_Blob_bytes(encode_cesu8([0xD800])), compare_Blob); +check('Blob unpaired low surrogate (invalid utf-8)', func_Blob_bytes(encode_cesu8([0xDC00])), compare_Blob); +check('Blob paired surrogates (invalid utf-8)', func_Blob_bytes(encode_cesu8([0xD800, 0xDC00])), compare_Blob); + +function func_Blob_empty() { + return new Blob(['']); +} +check('Blob empty', func_Blob_empty , compare_Blob); +function func_Blob_NUL() { + return new Blob(['\u0000']); +} +check('Blob NUL', func_Blob_NUL, compare_Blob); + +async_test(function(test_obj) { + check(test_obj.name, [test_obj.step(func_Blob_basic)], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); +}, 'Array Blob object, Blob basic'); +async_test(function(test_obj) { + check(test_obj.name, [test_obj.step(func_Blob_bytes([0xD800]))], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); +}, 'Array Blob object, Blob unpaired high surrogate (invalid utf-8)'); +async_test(function(test_obj) { + check(test_obj.name, [test_obj.step(func_Blob_bytes([0xDC00]))], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); +}, 'Array Blob object, Blob unpaired low surrogate (invalid utf-8)'); +async_test(function(test_obj) { + check(test_obj.name, [test_obj.step(func_Blob_bytes([0xD800, 0xDC00]))], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); +}, 'Array Blob object, Blob paired surrogates (invalid utf-8)'); +async_test(function(test_obj) { + check(test_obj.name, [test_obj.step(func_Blob_empty)], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); +}, 'Array Blob object, Blob empty'); +async_test(function(test_obj) { + check(test_obj.name, [test_obj.step(func_Blob_NUL)], compare_Array(enumerate_props(compare_Blob, test_obj), true), test_obj); +}, 'Array Blob object, Blob NUL'); + +async_test(function(test_obj) { + check(test_obj.name, {'x':test_obj.step(func_Blob_basic)}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); +}, 'Object Blob object, Blob basic'); +async_test(function(test_obj) { + check(test_obj.name, {'x':test_obj.step(func_Blob_bytes([0xD800]))}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); +}, 'Object Blob object, Blob unpaired high surrogate (invalid utf-8)'); +async_test(function(test_obj) { + check(test_obj.name, {'x':test_obj.step(func_Blob_bytes([0xDC00]))}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); +}, 'Object Blob object, Blob unpaired low surrogate (invalid utf-8)'); +async_test(function(test_obj) { + check(test_obj.name, {'x':test_obj.step(func_Blob_bytes([0xD800, 0xDC00]))}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); +}, 'Object Blob object, Blob paired surrogates (invalid utf-8)'); +async_test(function(test_obj) { + check(test_obj.name, {'x':test_obj.step(func_Blob_empty)}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); +}, 'Object Blob object, Blob empty'); +async_test(function(test_obj) { + check(test_obj.name, {'x':test_obj.step(func_Blob_NUL)}, compare_Object(enumerate_props(compare_Blob, test_obj), true), test_obj); +}, 'Object Blob object, Blob NUL'); + +function compare_File(actual, input, test_obj) { + assert_true(actual instanceof File, 'instanceof File'); + assert_equals(actual.name, input.name, 'name'); + assert_equals(actual.lastModified, input.lastModified, 'lastModified'); + compare_Blob(actual, input, test_obj, true); +} +function func_File_basic() { + return new File(['foo'], 'bar', {type:'text/x-bar', lastModified:42}); +} +check('File basic', func_File_basic, compare_File); + +function compare_FileList(actual, input, test_obj) { + if (typeof actual === 'string') + assert_unreached(actual); + assert_true(actual instanceof FileList, 'instanceof FileList'); + assert_equals(actual.length, input.length, 'length'); + assert_not_equals(actual, input); + // XXX when there's a way to populate or construct a FileList, + // check the items in the FileList + if (test_obj) + test_obj.done(); +} +function func_FileList_empty() { + var input = document.createElement('input'); + input.type = 'file'; + return input.files; +} +check('FileList empty', func_FileList_empty, compare_FileList); +check('Array FileList object, FileList empty', [func_FileList_empty], compare_Array(enumerate_props(compare_FileList))); +check('Object FileList object, FileList empty', {'x':func_FileList_empty}, compare_Object(enumerate_props(compare_FileList))); + +function compare_ArrayBufferView(view) { + var Type = window[view]; + return function(actual, input, test_obj) { + if (typeof actual === 'string') + assert_unreached(actual); + assert_true(actual instanceof Type, 'instanceof '+view); + assert_equals(actual.length, input.length, 'length'); + assert_not_equals(actual.buffer, input.buffer, 'buffer'); + for (var i = 0; i < actual.length; ++i) { + assert_equals(actual[i], input[i], 'actual['+i+']'); + } + if (test_obj) + test_obj.done(); + }; +} +function compare_ImageData(actual, input, test_obj) { + if (typeof actual === 'string') + assert_unreached(actual); + assert_equals(actual.width, input.width, 'width'); + assert_equals(actual.height, input.height, 'height'); + assert_not_equals(actual.data, input.data, 'data'); + compare_ArrayBufferView('Uint8ClampedArray')(actual.data, input.data, null); + if (test_obj) + test_obj.done(); +} +function func_ImageData_1x1_transparent_black() { + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('2d'); + return ctx.createImageData(1, 1); +} +check('ImageData 1x1 transparent black', func_ImageData_1x1_transparent_black, compare_ImageData); +function func_ImageData_1x1_non_transparent_non_black() { + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('2d'); + var imagedata = ctx.createImageData(1, 1); + imagedata.data[0] = 100; + imagedata.data[1] = 101; + imagedata.data[2] = 102; + imagedata.data[3] = 103; + return imagedata; +} +check('ImageData 1x1 non-transparent non-black', func_ImageData_1x1_non_transparent_non_black, compare_ImageData); +async_test(function(test_obj) { + check(test_obj.name, [test_obj.step(func_ImageData_1x1_transparent_black)], compare_Array(enumerate_props(compare_ImageData)), test_obj); +}, 'Array ImageData object, ImageData 1x1 transparent black'); +async_test(function(test_obj) { + check(test_obj.name, [test_obj.step(func_ImageData_1x1_non_transparent_non_black)], compare_Array(enumerate_props(compare_ImageData)), test_obj); +}, 'Array ImageData object, ImageData 1x1 non-transparent non-black'); +async_test(function(test_obj) { + check(test_obj.name, {'x':test_obj.step(func_ImageData_1x1_transparent_black)}, compare_Object(enumerate_props(compare_ImageData)), test_obj); +}, 'Object ImageData object, ImageData 1x1 transparent black'); +async_test(function(test_obj) { + check(test_obj.name, {'x':test_obj.step(func_ImageData_1x1_non_transparent_non_black)}, compare_Object(enumerate_props(compare_ImageData)), test_obj); +}, 'Object ImageData object, ImageData 1x1 non-transparent non-black'); + +function compare_ImageBitmap(actual, input, test_obj) { + if (typeof actual === 'string') + assert_unreached(actual); + assert_equals(actual instanceof ImageBitmap, 'instanceof ImageBitmap'); + assert_not_equals(actual, input); + // XXX paint the ImageBitmap on a canvas and check the data + if (test_obj) + test_obj.done(); +} +function get_canvas_1x1_transparent_black() { + var canvas = document.createElement('canvas'); + canvas.width = 1; + canvas.height = 1; + return canvas; +} +async_test(function(test_obj) { + var canvas = get_canvas_1x1_transparent_black(); + createImageBitmap(canvas, function(image) { check(test_obj.name, image, compare_ImageBitmap, test_obj); }); +}, 'ImageBitmap 1x1 transparent black'); +function get_canvas_1x1_non_transparent_non_black() { + var canvas = document.createElement('canvas'); + canvas.width = 1; + canvas.height = 1; + var ctx = canvas.getContext('2d'); + var imagedata = ctx.getImageData(0, 0, 1, 1); + imagedata.data[0] = 100; + imagedata.data[1] = 101; + imagedata.data[2] = 102; + imagedata.data[3] = 103; + return canvas; +} +async_test(function(test_obj) { + var canvas = get_canvas_1x1_non_transparent_non_black(); + createImageBitmap(canvas, function(image) { check(test_obj.name, image, compare_ImageBitmap, test_obj); }); +}, 'ImageBitmap 1x1 non-transparent non-black'); + +async_test(function(test_obj) { + var canvas = get_canvas_1x1_transparent_black(); + createImageBitmap(canvas, function(image) { check(test_obj.name, [image], compare_Array(enumerate_props(compare_ImageBitmap)), test_obj); }); +}, 'Array ImageBitmap object, ImageBitmap 1x1 transparent black'); +async_test(function(test_obj) { + var canvas = get_canvas_1x1_non_transparent_non_black(); + createImageBitmap(canvas, function(image) { check(test_obj.name, [image], compare_Array(enumerate_props(compare_ImageBitmap)), test_obj); }); +}, 'Array ImageBitmap object, ImageBitmap 1x1 non-transparent non-black'); + +async_test(function(test_obj) { + var canvas = get_canvas_1x1_transparent_black(); + createImageBitmap(canvas, function(image) { check(test_obj.name, {'x':image}, compare_Object(enumerate_props(compare_ImageBitmap)), test_obj); }); +}, 'Object ImageBitmap object, ImageBitmap 1x1 transparent black'); +async_test(function(test_obj) { + var canvas = get_canvas_1x1_non_transparent_non_black(); + createImageBitmap(canvas, function(image) { check(test_obj.name, {'x':image}, compare_Object(enumerate_props(compare_ImageBitmap)), test_obj); }); +}, 'Object ImageBitmap object, ImageBitmap 1x1 non-transparent non-black'); + +check('Array sparse', new Array(10), compare_Array(enumerate_props(compare_primitive))); +check('Array with non-index property', function() { + var rv = []; + rv.foo = 'bar'; + return rv; +}, compare_Array(enumerate_props(compare_primitive))); +check('Object with index property and length', {'0':'foo', 'length':1}, compare_Object(enumerate_props(compare_primitive))); +function check_circular_property(prop) { + return function(actual) { + assert_equals(actual[prop], actual); + }; +} +check('Array with circular reference', function() { + var rv = []; + rv[0] = rv; + return rv; +}, compare_Array(check_circular_property('0'))); +check('Object with circular reference', function() { + var rv = {}; + rv['x'] = rv; + return rv; +}, compare_Object(check_circular_property('x'))); +function check_identical_property_values(prop1, prop2) { + return function(actual) { + assert_equals(actual[prop1], actual[prop2]); + }; +} +check('Array with identical property values', function() { + var obj = {} + return [obj, obj]; +}, compare_Array(check_identical_property_values('0', '1'))); +check('Object with identical property values', function() { + var obj = {} + return {'x':obj, 'y':obj}; +}, compare_Object(check_identical_property_values('x', 'y'))); + +function check_absent_property(prop) { + return function(actual) { + assert_false(prop in actual); + }; +} +check('Object with property on prototype', function() { + var Foo = function() {}; + Foo.prototype = {'foo':'bar'}; + return new Foo(); +}, compare_Object(check_absent_property('foo'))); + +check('Object with non-enumerable property', function() { + var rv = {}; + Object.defineProperty(rv, 'foo', {value:'bar', enumerable:false, writable:true, configurable:true}); + return rv; +}, compare_Object(check_absent_property('foo'))); + +function check_writable_property(prop) { + return function(actual, input) { + assert_equals(actual[prop], input[prop]); + actual[prop] += ' baz'; + assert_equals(actual[prop], input[prop] + ' baz'); + }; +} +check('Object with non-writable property', function() { + var rv = {}; + Object.defineProperty(rv, 'foo', {value:'bar', enumerable:true, writable:false, configurable:true}); + return rv; +}, compare_Object(check_writable_property('foo'))); + +function check_configurable_property(prop) { + return function(actual, input) { + assert_equals(actual[prop], input[prop]); + delete actual[prop]; + assert_false('prop' in actual); + }; +} +check('Object with non-configurable property', function() { + var rv = {}; + Object.defineProperty(rv, 'foo', {value:'bar', enumerable:true, writable:true, configurable:false}); + return rv; +}, compare_Object(check_configurable_property('foo'))); diff --git a/testing/web-platform/tests/workers/semantics/structured-clone/dedicated.html b/testing/web-platform/tests/workers/semantics/structured-clone/dedicated.html new file mode 100644 index 000000000..5dd8c3561 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/structured-clone/dedicated.html @@ -0,0 +1,9 @@ + +structured clone to dedicated worker + + +
+ + diff --git a/testing/web-platform/tests/workers/semantics/structured-clone/dedicated.js b/testing/web-platform/tests/workers/semantics/structured-clone/dedicated.js new file mode 100644 index 000000000..4744578b2 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/structured-clone/dedicated.js @@ -0,0 +1,4 @@ +importScripts('worker-common.js'); +onmessage = function(ev) { + check(ev.data, self); +}; diff --git a/testing/web-platform/tests/workers/semantics/structured-clone/shared.html b/testing/web-platform/tests/workers/semantics/structured-clone/shared.html new file mode 100644 index 000000000..6f74354d4 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/structured-clone/shared.html @@ -0,0 +1,9 @@ + +structured clone to shared worker + + +
+ + diff --git a/testing/web-platform/tests/workers/semantics/structured-clone/shared.js b/testing/web-platform/tests/workers/semantics/structured-clone/shared.js new file mode 100644 index 000000000..372a9ec98 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/structured-clone/shared.js @@ -0,0 +1,6 @@ +importScripts('worker-common.js'); +onconnect = function(connect_ev) { + connect_ev.ports[0].onmessage = function(message_ev) { + check(message_ev.data, this); + }; +}; diff --git a/testing/web-platform/tests/workers/semantics/structured-clone/worker-common.js b/testing/web-platform/tests/workers/semantics/structured-clone/worker-common.js new file mode 100644 index 000000000..fd63ff5a5 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/structured-clone/worker-common.js @@ -0,0 +1,1018 @@ +var msg = decodeURIComponent(location.hash.substr(1)); + +var log = []; +function check_true(actual, msg) { + if (actual !== true) { + log.push(msg); + return false; + } + return true; +} + +function check_Blob(msg, input, port, expect_File, orig_input) { + expect_File = !!expect_File; + orig_input = orig_input || input; + try { + var expected; + switch (msg) { + case 'Blob basic': + case 'File basic': + expected = [0x66, 0x6F, 0x6F]; + expected.type = 'text/x-bar'; + if (expect_File) { + expected.name = 'bar'; + expected.lastModified = 42; + } + break; + case 'Blob unpaired high surrogate (invalid utf-8)': + expected = [0xED, 0xA0, 0x80]; + expected.type = ''; + break; + case 'Blob unpaired low surrogate (invalid utf-8)': + expected = [0xED, 0xB0, 0x80]; + expected.type = ''; + break; + case 'Blob paired surrogates (invalid utf-8)': + expected = [0xED, 0xA0, 0x80, 0xED, 0xB0, 0x80]; + expected.type = ''; + break; + case 'Blob empty': + expected = []; + expected.type = ''; + break; + case 'Blob NUL': + var expected = [0x00]; + expected.type = ''; + break; + default: + check_true(false, 'check_Blob: unknown test'); + return; + break; + } + if (check_true(input instanceof Blob, 'input instanceof Blob') && + check_true((input instanceof File) == expect_File, '(input instanceof File) == expect_File') && + check_true(input.size === expected.length, 'input.size === expected.length') && + check_true(input.type === expected.type, 'input.type === expected.type')) { + if (!expect_File || (check_true(input.name === expected.name, 'input.name === expected.name') && + check_true(input.lastModified === expected.lastModified))) { + var reader = new FileReader(); + var read_done = function() { + try { + var result = reader.result; + check_true(result.byteLength === expected.length, 'result.byteLength === expected.length') + var view = new DataView(result); + for (var i = 0; i < result.byteLength; ++i) { + check_true(view.getUint8(i) === expected[i], 'view.getUint8('+i+') === expected['+i+']') + } + if (log.length === 0) { + port.postMessage(orig_input); + } else { + port.postMessage('FAIL '+log); + } + close(); + } catch(ex) { + postMessage('FAIL '+ex); + close(); + } + } + var read_error = function() { port.postMessage('FAIL (got FileReader error)'); close(); }; + reader.readAsArrayBuffer(input); + reader.onload = read_done; + reader.onabort = reader.onerror = read_error; + } + } else { + port.postMessage('FAIL '+log); + close(); + } + } catch(ex) { + postMessage('FAIL '+ex); + close(); + } +} + +function check_ImageData(input, expected) { + if (check_true(input instanceof ImageData, 'input instanceof ImageData') && + check_true(input.width === expected.width, 'input.width === '+expected.width) && + check_true(input.height === expected.height, 'input.height === '+expected.height) && + check_true(input.data instanceof Uint8ClampedArray, 'input.data instanceof Uint8ClampedArray') && + check_true(input.data.length === expected.data.length, 'input.data.length === '+expected.data.length) && + check_true(!('CanvasPixelArray' in self), "!('CanvasPixelArray' in self)")) { + for (var i = 0; i < input.length; ++i) { + if (!(check_true(input.data[i] === expected.data[i], 'input.data['+i+'] === '+expected.data[i]))) { + return false; + } + } + return true; + } + return false; +} + +function check_ImageBitmap(input, expected) { + return check_true(input instanceof ImageBitmap, 'input instanceof ImageBitmap'); + // XXX paint it on a proxy canvas and check the data +} + +function check_RegExp(msg, input) { + // XXX ES6 spec doesn't define exact serialization for `source` (it allows several ways to escape) + switch (msg) { + case 'RegExp flags and lastIndex': + return check_true(input instanceof RegExp, "input instanceof RegExp") && + check_true(input.source === 'foo', "input.source === 'foo'") && + check_true(input.global === true, "input.global === true") && + check_true(input.ignoreCase === true, "input.ignoreCase === true") && + check_true(input.multiline === true, "input.multiline === true") && + check_true(input.lastIndex === 0, "input.lastIndex === 0"); + break; + case 'RegExp sticky flag': + return check_true(input instanceof RegExp, "input instanceof RegExp") && + check_true(input.source === 'foo', "input.source === 'foo'") && + check_true(input.global === false, "input.global === false") && + check_true(input.ignoreCase === false, "input.ignoreCase === false") && + check_true(input.multiline === false, "input.multiline === false") && + check_true(input.sticky === true, "input.sticky === true") && + check_true(input.unicode === false, "input.unicode === false") && + check_true(input.lastIndex === 0, "input.lastIndex === 0"); + break; + case 'RegExp unicode flag': + return check_true(input instanceof RegExp, "input instanceof RegExp") && + check_true(input.source === 'foo', "input.source === 'foo'") && + check_true(input.global === false, "input.global === false") && + check_true(input.ignoreCase === false, "input.ignoreCase === false") && + check_true(input.multiline === false, "input.multiline === false") && + check_true(input.sticky === false, "input.sticky === false") && + check_true(input.unicode === true, "input.unicode === true") && + check_true(input.lastIndex === 0, "input.lastIndex === 0"); + break; + case 'RegExp empty': + return check_true(input instanceof RegExp, "input instanceof RegExp") && + check_true(input.source === '(?:)', "input.source === '(?:)'") && + check_true(input.global === false, "input.global === false") && + check_true(input.ignoreCase === false, "input.ignoreCase === false") && + check_true(input.multiline === false, "input.multiline === false") && + check_true(input.lastIndex === 0, "input.lastIndex === 0"); + break; + case 'RegExp slash': + return check_true(input instanceof RegExp, "input instanceof RegExp") && + check_true(input.source === '\\/', "input.source === '\\\\/'") && + check_true(input.global === false, "input.global === false") && + check_true(input.ignoreCase === false, "input.ignoreCase === false") && + check_true(input.multiline === false, "input.multiline === false") && + check_true(input.lastIndex === 0, "input.lastIndex === 0"); + break; + case 'RegExp new line': + return check_true(input instanceof RegExp, "input instanceof RegExp") && + check_true(input.source === '\\n', "input.source === '\\\\n'") && + check_true(input.global === false, "input.global === false") && + check_true(input.ignoreCase === false, "input.ignoreCase === false") && + check_true(input.multiline === false, "input.multiline === false") && + check_true(input.lastIndex === 0, "input.lastIndex === 0"); + break; + default: + check_true(false, 'check_RegExp: unknown test'); + return false; + break; + } +} + +function check_FileList(msg, input) { + try { + return check_true(input instanceof FileList, 'input instanceof FileList') && + check_true(input.length === 0, 'input.length === 0'); + } catch(ex) { + return check_true(false, ex); + } +} + +function check(input, port) { + try { + switch (msg) { + case 'primitive undefined': + if (check_true(input === undefined, 'input === undefined')) { + port.postMessage(input); + close(); + } + break; + case 'primitive null': + if (check_true(input === null, 'input === null')) { + port.postMessage(input); + close(); + } + break; + case 'primitive true': + if (check_true(input === true, 'input === true')) { + port.postMessage(input); + close(); + } + break; + case 'primitive false': + if (check_true(input === false, 'input === false')) { + port.postMessage(input); + close(); + } + break; + case 'primitive string, empty string': + if (check_true(input === '', "input === ''")) { + port.postMessage(input); + close(); + } + break; + case 'primitive string, lone high surrogate': + if (check_true(input === '\uD800', "input === '\uD800'")) { + port.postMessage(input); + close(); + } + break; + case 'primitive string, lone low surrogate': + if (check_true(input === '\uDC00', "input === '\uDC00'")) { + port.postMessage(input); + close(); + } + break; + case 'primitive string, NUL': + if (check_true(input === '\u0000', "input === '\u0000'")) { + port.postMessage(input); + close(); + } + break; + case 'primitive string, astral character': + if (check_true(input === '\uDBFF\uDFFD', "input === '\uDBFF\uDFFD'")) { + port.postMessage(input); + close(); + } + break; + case 'primitive number, 0.2': + if (check_true(input === 0.2, "input === 0.2")) { + port.postMessage(input); + close(); + } + break; + case 'primitive number, 0': + if (check_true(input === 0, "input === 0") && + check_true(1/input === Infinity, "1/input === Infinity")) { + port.postMessage(input); + close(); + } + break; + case 'primitive number, -0': + if (check_true(input === 0, "input === 0") && + check_true(1/input === -Infinity, "1/input === -Infinity")) { + port.postMessage(input); + close(); + } + break; + case 'primitive number, NaN': + if (check_true(input !== input, "input !== input")) { + port.postMessage(input); + close(); + } + break; + case 'primitive number, Infinity': + if (check_true(input === Infinity, "input === Infinity")) { + port.postMessage(input); + close(); + } + break; + case 'primitive number, -Infinity': + if (check_true(input === -Infinity, "input === -Infinity")) { + port.postMessage(input); + close(); + } + break; + case 'primitive number, 9007199254740992': + if (check_true(input === 9007199254740992, "input === 9007199254740992")) { + port.postMessage(input); + close(); + } + break; + case 'primitive number, -9007199254740992': + if (check_true(input === -9007199254740992, "input === -9007199254740992")) { + port.postMessage(input); + close(); + } + break; + case 'primitive number, 9007199254740994': + if (check_true(input === 9007199254740994, "input === 9007199254740994")) { + port.postMessage(input); + close(); + } + break; + case 'primitive number, -9007199254740994': + if (check_true(input === -9007199254740994, "input === -9007199254740994")) { + port.postMessage(input); + close(); + break; + } + case 'Array primitives': + if (check_true(input instanceof Array, 'input instanceof Array') && + check_true(input.length === 19, 'input.length === 19') && + check_true(input[0] === undefined, 'input[0] === undefined') && + check_true(input[1] === null, 'input[1] === null') && + check_true(input[2] === true, 'input[2] === true') && + check_true(input[3] === false, 'input[3] === false') && + check_true(input[4] === '', "input[4] === ''") && + check_true(input[5] === '\uD800', "input[5] === '\\uD800'") && + check_true(input[6] === '\uDC00', "input[6] === '\\uDC00'") && + check_true(input[7] === '\u0000', "input[7] === '\\u0000'") && + check_true(input[8] === '\uDBFF\uDFFD', "input[8] === '\\uDBFF\\uDFFD'") && + check_true(input[9] === 0.2, "input[9] === 0.2") && + check_true(1/input[10] === Infinity, "1/input[10] === Infinity") && + check_true(1/input[11] === -Infinity, "1/input[11] === -Infinity") && + check_true(input[12] !== input[11], "input[12] !== input[11]") && + check_true(input[13] === Infinity, "input[13] === Infinity") && + check_true(input[14] === -Infinity, "input[14] === -Infinity") && + check_true(input[15] === 9007199254740992, "input[15] === 9007199254740992") && + check_true(input[16] === -9007199254740992, "input[16] === -9007199254740992") && + check_true(input[17] === 9007199254740994, "input[17] === 9007199254740994") && + check_true(input[18] === -9007199254740994, "input[18] === -9007199254740994")) { + port.postMessage(input); + close(); + } + break; + case 'Object primitives': + (function() { + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)') && + check_true(input['undefined'] === undefined, "input['undefined'] === undefined") && + check_true(input['null'] === null, "input['null'] === null") && + check_true(input['true'] === true, "input['true'] === true") && + check_true(input['false'] === false, "input['false'] === false") && + check_true(input['empty'] === '', "input['empty'] === ''") && + check_true(input['high surrogate'] === '\uD800', "input['high surrogate'] === '\uD800'") && + check_true(input['low surrogate'] === '\uDC00', "input['low surrogate'] === '\uDC00'") && + check_true(input['nul'] === '\u0000', "input['nul'] === '\u0000'") && + check_true(input['astral'] === '\uDBFF\uDFFD', "input['astral'] === '\uDBFF\uDFFD'") && + check_true(input['0.2'] === 0.2, "input['0.2'] === 0.2") && + check_true(1/input['0'] === Infinity, "1/input['0'] === Infinity") && + check_true(1/input['-0'] === -Infinity, "1/input['-0'] === -Infinity") && + check_true(input['NaN'] !== input['NaN'], "input['NaN'] !== input['NaN']") && + check_true(input['Infinity'] === Infinity, "input['Infinity'] === Infinity") && + check_true(input['-Infinity'] === -Infinity, "input['-Infinity'] === -Infinity") && + check_true(input['9007199254740992'] === 9007199254740992, "input['9007199254740992'] === 9007199254740992") && + check_true(input['-9007199254740992'] === -9007199254740992, "input['-9007199254740992'] === -9007199254740992") && + check_true(input['9007199254740994'] === 9007199254740994, "input['9007199254740994'] === 9007199254740994") && + check_true(input['-9007199254740994'] === -9007199254740994, "input['9007199254740994'] === -9007199254740994")) { + var i = 0; + for (var x in input) { + i++; + } + if (check_true(i === 19, 'i === 19')) { + port.postMessage(input); + close(); + } + } + })(); + break; + case 'Boolean true': + if (check_true(input instanceof Boolean, "input instanceof Boolean") && + check_true(String(input) === 'true', "String(input) === 'true'")) { + port.postMessage(input); + close(); + } + break; + case 'Boolean false': + if (check_true(input instanceof Boolean, "input instanceof Boolean") && + check_true(String(input) === 'false', "String(input) === 'false'")) { + port.postMessage(input); + close(); + } + break; + case 'Array Boolean objects': + (function() { + if (check_true(input instanceof Array, 'input instanceof Array') && + check_true(input.length === 2, 'input.length === 2') && + check_true(String(input[0]) === 'true', "String(input[0]) === 'true'") && + check_true(String(input[1]) === 'false', "String(input[1]) === 'false'")) { + for (var i = 0; i < input.length; ++i) { + if (!check_true(input[i] instanceof Boolean, 'input['+i+'] instanceof Boolean')) + return; + } + port.postMessage(input); + close(); + } + })(); + break; + case 'Object Boolean objects': + (function() { + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)') && + check_true(String(input['true']) === 'true', "String(input['true']) === 'true'") && + check_true(String(input['false']) === 'false', "String(input['false']) === 'false'")) { + var i = 0; + for (var x in input) { + i++; + if (!check_true(input[x] instanceof Boolean, 'input['+x+'] instanceof Boolean')) + return; + } + if (check_true(i === 2, 'i === 2')) { + port.postMessage(input); + close(); + } + } + })(); + break; + case 'String empty string': + if (check_true(input instanceof String, "input instanceof String") && + check_true(String(input) === '', "String(input) === ''")) { + port.postMessage(input); + close(); + } + break; + case 'String lone high surrogate': + if (check_true(input instanceof String, "input instanceof String") && + check_true(String(input) === '\uD800', "String(input) === '\\uD800'")) { + port.postMessage(input); + close(); + } + break; + case 'String lone low surrogate': + if (check_true(input instanceof String, "input instanceof String") && + check_true(String(input) === '\uDC00', "String(input) === '\\uDC00'")) { + port.postMessage(input); + close(); + } + break; + case 'String NUL': + if (check_true(input instanceof String, "input instanceof String") && + check_true(String(input) === '\u0000', "String(input) === '\\u0000'")) { + port.postMessage(input); + close(); + } + break; + case 'String astral character': + if (check_true(input instanceof String, "input instanceof String") && + check_true(String(input) === '\uDBFF\uDFFD', "String(input) === '\\uDBFF\\uDFFD'")) { + port.postMessage(input); + close(); + } + break; + case 'Array String objects': + (function() { + if (check_true(input instanceof Array, 'input instanceof Array') && + check_true(input.length === 5, 'input.length === 5') && + check_true(String(input[0]) === '', "String(input[0]) === ''") && + check_true(String(input[1]) === '\uD800', "String(input[1]) === '\\uD800'") && + check_true(String(input[2]) === '\uDC00', "String(input[1]) === '\\uDC00'") && + check_true(String(input[3]) === '\u0000', "String(input[2]) === '\\u0000'") && + check_true(String(input[4]) === '\uDBFF\uDFFD', "String(input[3]) === '\\uDBFF\\uDFFD'")) { + for (var i = 0; i < input.length; ++i) { + if (!check_true(input[i] instanceof String, 'input['+i+'] instanceof String')) + return; + } + port.postMessage(input); + close(); + } + })(); + break; + case 'Object String objects': + (function() { + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)') && + check_true(String(input['empty']) === '', "String(input['empty']) === ''") && + check_true(String(input['high surrogate']) === '\uD800', "String(input['high surrogate']) === '\\uD800'") && + check_true(String(input['low surrogate']) === '\uDC00', "String(input['low surrogate']) === '\\uDC00'") && + check_true(String(input['nul']) === '\u0000', "String(input['nul']) === '\\u0000'") && + check_true(String(input['astral']) === '\uDBFF\uDFFD', "String(input['astral']) === '\\uDBFF\\uDFFD'")) { + var i = 0; + for (var x in input) { + i++; + if (!check_true(input[x] instanceof String, 'input['+x+'] instanceof Boolean')) + return; + } + if (check_true(i === 5, 'i === 5')) { + port.postMessage(input); + close(); + } + } + })(); + break; + case 'Number 0.2': + if (check_true(input instanceof Number, "input instanceof Number") && + check_true(Number(input) === 0.2, "Number(input) === 0.2")) { + port.postMessage(input); + close(); + } + break; + case 'Number 0': + if (check_true(input instanceof Number, "input instanceof Number") && + check_true(1/Number(input) === Infinity, "1/Number(input) === Infinity")) { + port.postMessage(input); + close(); + } + break; + case 'Number -0': + if (check_true(input instanceof Number, "input instanceof Number") && + check_true(1/Number(input) === -Infinity, "1/Number(input) === -Infinity")) { + port.postMessage(input); + close(); + } + break; + case 'Number NaN': + if (check_true(input instanceof Number, "input instanceof Number") && + check_true(Number(input) !== Number(input), "Number(input) !== Number(input)")) { + port.postMessage(input); + close(); + } + break; + case 'Number Infinity': + if (check_true(input instanceof Number, "input instanceof Number") && + check_true(Number(input) === Infinity, "Number(input) === Infinity")) { + port.postMessage(input); + close(); + } + break; + case 'Number -Infinity': + if (check_true(input instanceof Number, "input instanceof Number") && + check_true(Number(input) === -Infinity, "Number(input) === -Infinity")) { + port.postMessage(input); + close(); + } + break; + case 'Number 9007199254740992': + if (check_true(input instanceof Number) && + check_true(Number(input) === 9007199254740992, "Number(input) === 9007199254740992")) { + port.postMessage(input); + close(); + } + break; + case 'Number -9007199254740992': + if (check_true(input instanceof Number, "input instanceof Number") && + check_true(Number(input) === -9007199254740992, "Number(input) === -9007199254740992")) { + port.postMessage(input); + close(); + } + break; + case 'Number 9007199254740994': + if (check_true(input instanceof Number, "input instanceof Number") && + check_true(Number(input) === 9007199254740994, "Number(input) === 9007199254740994")) { + port.postMessage(input); + close(); + } + break; + case 'Number -9007199254740994': + if (check_true(input instanceof Number, "input instanceof Number") && + check_true(Number(input) === -9007199254740994, "Number(input) === -9007199254740994")) { + port.postMessage(input); + close(); + } + break; + case 'Array Number objects': + (function() { + if (check_true(input instanceof Array, 'input instanceof Array') && + check_true(input.length === 10, 'input.length === 10') && + check_true(Number(input[0]) === 0.2, "Number(input[0]) === 0.2") && + check_true(1/Number(input[1]) === Infinity, "1/Number(input[1]) === Infinity") && + check_true(1/Number(input[2]) === -Infinity, "1/Number(input[2]) === -Infinity") && + check_true(Number(input[3]) !== Number(input[3]), "Number(input[3]) !== Number(input[3])") && + check_true(Number(input[4]) === Infinity, "Number(input[4]) === Infinity") && + check_true(Number(input[5]) === -Infinity, "Number(input[5]) === -Infinity") && + check_true(Number(input[6]) === 9007199254740992, "Number(input[6]) === 9007199254740992") && + check_true(Number(input[7]) === -9007199254740992, "Number(input[7]) === -9007199254740992") && + check_true(Number(input[8]) === 9007199254740994, "Number(input[8]) === 9007199254740994") && + check_true(Number(input[9]) === -9007199254740994, "Number(input[9]) === -9007199254740994")) { + for (var i = 0; i < input.length; ++i) { + if (!check_true(input[i] instanceof Number, 'input['+i+'] instanceof Number')) + return; + } + port.postMessage(input); + close(); + } + })(); + break; + case 'Object Number objects': + (function() { + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)') && + check_true(Number(input['0.2']) === 0.2, "Number(input['0.2']) === 0.2") && + check_true(1/Number(input['0']) === Infinity, "1/Number(input['0']) === Infinity") && + check_true(1/Number(input['-0']) === -Infinity, "1/Number(input['-0']) === -Infinity") && + check_true(Number(input['NaN']) !== Number(input['NaN']), "Number(input['NaN']) !== Number(input['NaN'])") && + check_true(Number(input['Infinity']) === Infinity, "Number(input['Infinity']) === Infinity") && + check_true(Number(input['-Infinity']) === -Infinity, "Number(input['-Infinity']) === -Infinity") && + check_true(Number(input['9007199254740992']) === 9007199254740992, "Number(input['9007199254740992']) === 9007199254740992") && + check_true(Number(input['-9007199254740992']) === -9007199254740992, "Number(input['-9007199254740992']) === -9007199254740992") && + check_true(Number(input['9007199254740994']) === 9007199254740994, "Number(input['9007199254740994']) === 9007199254740994") && + check_true(Number(input['-9007199254740994']) === -9007199254740994, "Number(input['-9007199254740994']) === -9007199254740994")) { + var i = 0; + for (var x in input) { + i++; + if (!check_true(input[x] instanceof Number, 'input['+x+'] instanceof Number')) + return; + } + if (check_true(i === 10, 'i === 10')) { + port.postMessage(input); + close(); + } + } + })(); + break; + case 'Date 0': + if (check_true(input instanceof Date, "input instanceof Date") && + check_true(1/Number(input) === 1/Number(new Date(0)), "1/Number(input) === 1/Number(new Date(0))")) { + port.postMessage(input); + close(); + } + break; + case 'Date -0': + if (check_true(input instanceof Date, "input instanceof Date") && + check_true(1/Number(input) === 1/Number(new Date(-0)), "1/Number(input) === 1/Number(new Date(-0))")) { + port.postMessage(input); + close(); + } + break; + case 'Date -8.64e15': + if (check_true(input instanceof Date, "input instanceof Date") && + check_true(Number(input) === -8.64e15, "Number(input) === -8.64e15")) { + port.postMessage(input); + close(); + } + break; + case 'Date 8.64e15': + if (check_true(input instanceof Date, "input instanceof Date") && + check_true(Number(input) === 8.64e15, "Number(input) === 8.64e15")) { + port.postMessage(input); + close(); + } + break; + case 'Array Date objects': + (function() { + if (check_true(input instanceof Array, 'input instanceof Array') && + check_true(input.length === 4, 'input.length === 4') && + check_true(1/Number(input[0]) === 1/new Date(0), '1/Number(input[0]) === 1/new Date(0)') && + check_true(1/Number(input[1]) === 1/new Date(-0), '1/Number(input[1]) === 1/new Date(-0)') && + check_true(Number(input[2]) === -8.64e15, 'Number(input[2]) === -8.64e15') && + check_true(Number(input[3]) === 8.64e15, 'Number(input[3]) === 8.64e15')) { + for (var i = 0; i < input.length; ++i) { + if (!check_true(input[i] instanceof Date, 'input['+i+'] instanceof Date')) + return; + } + port.postMessage(input); + close(); + } + })(); + break; + case 'Object Date objects': + (function() { + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)') && + check_true(1/Number(input['0']) === 1/new Date(0), "1/Number(input['0']) === 1/new Date(0)") && + check_true(1/Number(input['-0']) === 1/new Date(-0), "1/Number(input[1]) === 1/new Date(-0)") && + check_true(Number(input['-8.64e15']) === -8.64e15, "Number(input['-8.64e15']) === -8.64e15") && + check_true(Number(input['8.64e15']) === 8.64e15, "Number(input['8.64e15']) === 8.64e15")) { + var i = 0; + for (var x in input) { + i++; + if (!check_true(input[x] instanceof Date, 'input['+x+'] instanceof Date')) + return; + } + port.postMessage(input); + close(); + } + })(); + break; + case 'RegExp flags and lastIndex': + case 'RegExp empty': + case 'RegExp slash': + case 'RegExp new line': + if (check_RegExp(msg, input)) { + port.postMessage(input); + close(); + } + break; + case 'Array RegExp object, RegExp flags and lastIndex': + case 'Array RegExp object, RegExp empty': + case 'Array RegExp object, RegExp slash': + case 'Array RegExp object, RegExp new line': + if (check_true(input instanceof Array, 'input instanceof Array') && + check_true(input.length === 1, 'input.length === 1') && + check_RegExp(msg.substr('Array RegExp object, '.length), input[0])) { + port.postMessage(input); + close(); + } + break; + case 'Object RegExp object, RegExp flags and lastIndex': + case 'Object RegExp object, RegExp empty': + case 'Object RegExp object, RegExp slash': + case 'Object RegExp object, RegExp new line': + (function() { + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)') && + check_RegExp(msg.substr('Object RegExp object, '.length), input['x'])) { + var i = 0; + for (var x in input) { + i++; + } + if (check_true(i === 1, 'i === 1')) { + port.postMessage(input); + close(); + } + } + })(); + break; + case 'Blob basic': + case 'Blob unpaired high surrogate (invalid utf-8)': + case 'Blob unpaired low surrogate (invalid utf-8)': + case 'Blob paired surrogates (invalid utf-8)': + case 'Blob empty': + case 'Blob NUL': + check_Blob(msg, input, port); + // no postMessage or close here, check_Blob takes care of that + break; + case 'Array Blob object, Blob basic': + case 'Array Blob object, Blob unpaired high surrogate (invalid utf-8)': + case 'Array Blob object, Blob unpaired low surrogate (invalid utf-8)': + case 'Array Blob object, Blob paired surrogates (invalid utf-8)': + case 'Array Blob object, Blob empty': + case 'Array Blob object, Blob NUL': + if (check_true(input instanceof Array, 'input instanceof Array') && + check_true(input.length === 1, 'input.length === 1')) { + check_Blob(msg.substr('Array Blob object, '.length), input[0], port, false, input); + // no postMessage or close here, check_Blob takes care of that + } + break; + case 'Object Blob object, Blob basic': + case 'Object Blob object, Blob unpaired high surrogate (invalid utf-8)': + case 'Object Blob object, Blob unpaired low surrogate (invalid utf-8)': + case 'Object Blob object, Blob paired surrogates (invalid utf-8)': + case 'Object Blob object, Blob empty': + case 'Object Blob object, Blob NUL': + (function() { + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)')) { + var i = 0; + for (var x in input) { + i++; + } + if (check_true(i === 1, 'i === 1')) { + check_Blob(msg.substr('Object Blob object, '.length), input['x'], port, false, input); + // no postMessage or close here, check_Blob takes care of that + } + } + })(); + break; + case 'File basic': + check_Blob(msg, input, port, true); + // no postMessage or close here, check_Blob takes care of that + break; + case 'FileList empty': + if (check_FileList(msg, input)) { + port.postMessage(input); + close(); + } + break; + case 'Array FileList object, FileList empty': + if (check_true(input instanceof Array, 'input instanceof Array') && + check_true(input.length === 1, 'input.length === 1') && + check_FileList(msg.substr('Array FileList object, '.length), input[0])) { + port.postMessage(input); + close(); + } + break; + case 'Object FileList object, FileList empty': + (function() { + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)') && + check_FileList(msg.substr('Array FileList object, '.length), input['x'])) { + var i = 0; + for (var x in input) { + i++; + } + if (check_true(i === 1, 'i === 1')) { + port.postMessage(input); + close(); + } + } + })(); + break; + case 'ImageData 1x1 transparent black': + if (check_ImageData(input, {width:1, height:1, data:[0,0,0,0]})) { + port.postMessage(input); + close(); + } + break; + case 'ImageData 1x1 non-transparent non-black': + if (check_ImageData(input, {width:1, height:1, data:[100, 101, 102, 103]})) { + port.postMessage(input); + close(); + } + break; + case 'Array ImageData object, ImageData 1x1 transparent black': + if (check_true(input instanceof Array, 'input instanceof Array') && + check_true(input.length === 1, 'input.length === 1') && + check_ImageData(input[0], {width:1, height:1, data:[0,0,0,0]})) { + port.postMessage(input); + close(); + } + break; + case 'Array ImageData object, ImageData 1x1 non-transparent non-black': + if (check_true(input instanceof Array, 'input instanceof Array') && + check_true(input.length === 1, 'input.length === 1') && + check_ImageData(input[0], {width:1, height:1, data:[100, 101, 102, 103]})) { + port.postMessage(input); + close(); + } + break; + case 'Object ImageData object, ImageData 1x1 transparent black': + (function(){ + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)') && + check_ImageData(input['x'], {width:1, height:1, data:[0,0,0,0]})) { + var i = 0; + for (var x in input) { + i++; + } + if (check_true(i === 1, 'i === 1')) { + port.postMessage(input); + close(); + } + } + })(); + break; + case 'Object ImageData object, ImageData 1x1 non-transparent non-black': + (function() { + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)') && + check_ImageData(input['x'], {width:1, height:1, data:[100, 101, 102, 103]})) { + var i = 0; + for (var x in input) { + i++; + } + if (check_true(i === 1, 'i === 1')) { + port.postMessage(input); + close(); + } + } + })(); + break; + case 'ImageBitmap 1x1 transparent black': + if (check_ImageBitmap(input, {width:1, height:1, data:[0, 0, 0, 0]})) { + port.postMessage(input); + close(); + } + break; + case 'ImageBitmap 1x1 non-transparent non-black': + if (check_ImageBitmap(input, {width:1, height:1, data:[100, 101, 102, 103]})) { + port.postMessage(input); + close(); + } + break; + case 'Array ImageBitmap object, ImageBitmap 1x1 transparent black': + if (check_true(input instanceof Array, 'input instanceof Array') && + check_true(input.length === 1, 'input.length === 1') && + check_ImageBitmap(input[0], {width:1, height:1, data:[0, 0, 0, 0]})) { + port.postMessage(input); + close(); + } + break; + case 'Array ImageBitmap object, ImageBitmap 1x1 non-transparent non-black': + if (check_true(input instanceof Array, 'input instanceof Array') && + check_true(input.length === 1, 'input.length === 1') && + check_ImageBitmap(input[0], {width:1, height:1, data:[100, 101, 102, 103]})) { + port.postMessage(input); + close(); + } + break; + case 'Object ImageBitmap object, ImageBitmap 1x1 transparent black': + (function() { + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)') && + check_ImageBitmap(input['x'], {width:1, height:1, data:[0, 0, 0, 0]})) { + var i = 0; + for (var x in input) { + i++; + } + if (check_true(i === 1, 'i === 1')) { + port.postMessage(input); + close(); + } + } + })(); + break; + case 'Object ImageBitmap object, ImageBitmap 1x1 non-transparent non-black': + (function() { + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)') && + check_ImageBitmap(input['x'], {width:1, height:1, data:[100, 101, 102, 103]})) { + var i = 0; + for (var x in input) { + i++; + } + if (check_true(i === 1, 'i === 1')) { + port.postMessage(input); + close(); + } + } + })(); + break; + case 'Array sparse': + (function() { + if (check_true(input instanceof Array, 'input instanceof Array') && + check_true(input.length === 10, 'input.length === 10')) { + for (var x in input) { + check_true(false, 'unexpected enumerable property '+x); + return; + } + port.postMessage(input); + close(); + } + })(); + break; + case 'Array with non-index property': + if (check_true(input instanceof Array, 'input instanceof Array') && + check_true(input.length === 0, 'input.length === 0') && + check_true(input.foo === 'bar', "input.foo === 'bar'")) { + port.postMessage(input); + close(); + } + break; + case 'Object with index property and length': + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)') && + check_true(input[0] === 'foo', "input[0] === 'foo'") && + check_true(input.length === 1, 'input.length === 1')) { + port.postMessage(input); + close(); + } + break; + case 'Array with circular reference': + if (check_true(input instanceof Array, 'input instanceof Array') && + check_true(input.length === 1, 'input.length === 1') && + check_true(input[0] === input, "input[0] === input")) { + port.postMessage(input); + close(); + } + break; + case 'Object with circular reference': + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)') && + check_true(input['x'] === input, "input['x'] === input")) { + port.postMessage(input); + close(); + } + break; + case 'Array with identical property values': + if (check_true(input instanceof Array, 'input instanceof Array') && + check_true(input.length === 2, 'input.length === 2') && + check_true(input[0] === input[1], "input[0] === input[1]")) { + port.postMessage(input); + close(); + } + break; + case 'Object with identical property values': + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)') && + check_true(input['x'] === input['y'], "input['x'] === input['y']")) { + port.postMessage(input); + close(); + } + break; + case 'Object with property on prototype': + case 'Object with non-enumerable property': + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)') && + check_true(!('foo' in input), "!('foo' in input)")) { + input = {}; + Object.defineProperty(input, 'foo', {value:'bar', enumerable:false, writable:true, configurable:true}); + port.postMessage(input); + close(); + } + break; + case 'Object with non-writable property': + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)') && + check_true(input.foo === 'bar', "input.foo === bar")) { + input.foo += ' baz'; + if (check_true(input.foo === 'bar baz', "input.foo === 'bar baz'")) { + input = {}; + Object.defineProperty(input, 'foo', {value:'bar', enumerable:true, writable:false, configurable:true}); + port.postMessage(input); + close(); + } + } + break; + case 'Object with non-configurable property': + if (check_true(input instanceof Object, 'input instanceof Object') && + check_true(!(input instanceof Array), '!(input instanceof Array)') && + check_true(input.foo === 'bar', "input.foo === bar")) { + delete input.foo; + if (check_true(!('foo' in input), "!('foo' in input)")) { + input = {}; + Object.defineProperty(input, 'foo', {value:'bar', enumerable:true, writable:true, configurable:false}); + port.postMessage(input); + close(); + } + } + break; + + default: + port.postMessage('FAIL: unknown test'); + close(); + } + if (log.length > 0) { + port.postMessage('FAIL '+log); + close(); + } + } catch (ex) { + port.postMessage('FAIL '+ex); + close(); + } +} diff --git a/testing/web-platform/tests/workers/semantics/xhr/001-1.xml b/testing/web-platform/tests/workers/semantics/xhr/001-1.xml new file mode 100644 index 000000000..5d735bdf6 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/001-1.xml @@ -0,0 +1 @@ +foo \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/xhr/001.html b/testing/web-platform/tests/workers/semantics/xhr/001.html new file mode 100644 index 000000000..e26e21c62 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/001.html @@ -0,0 +1,35 @@ + + +async XMLHttpRequest in dedicated worker + + +
+ + + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/xhr/002.html b/testing/web-platform/tests/workers/semantics/xhr/002.html new file mode 100644 index 000000000..0d3386e98 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/002.html @@ -0,0 +1,32 @@ + + +sync XMLHttpRequest in dedicated worker + + +
+ + + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/xhr/003.html b/testing/web-platform/tests/workers/semantics/xhr/003.html new file mode 100644 index 000000000..70edaf417 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/003.html @@ -0,0 +1,41 @@ + + +async XMLHttpRequest in shared worker + + +
+ + + + diff --git a/testing/web-platform/tests/workers/semantics/xhr/004.html b/testing/web-platform/tests/workers/semantics/xhr/004.html new file mode 100644 index 000000000..ec5893a4b --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/004.html @@ -0,0 +1,36 @@ + + +sync XMLHttpRequest in shared worker + + +
+ + + + + diff --git a/testing/web-platform/tests/workers/semantics/xhr/005.html b/testing/web-platform/tests/workers/semantics/xhr/005.html new file mode 100644 index 000000000..84abdb0c4 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/005.html @@ -0,0 +1,21 @@ + +base url, dedicated worker + + +
+ + + diff --git a/testing/web-platform/tests/workers/semantics/xhr/006.html b/testing/web-platform/tests/workers/semantics/xhr/006.html new file mode 100644 index 000000000..7411b4bae --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/006.html @@ -0,0 +1,21 @@ + +base url, shared worker + + +
+ + + diff --git a/testing/web-platform/tests/workers/semantics/xhr/support/001-1.xml b/testing/web-platform/tests/workers/semantics/xhr/support/001-1.xml new file mode 100644 index 000000000..ecea58a93 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/support/001-1.xml @@ -0,0 +1 @@ +bar \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/xhr/support/005-1.js b/testing/web-platform/tests/workers/semantics/xhr/support/005-1.js new file mode 100644 index 000000000..45f6519a2 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/support/005-1.js @@ -0,0 +1,5 @@ +var xhr = new XMLHttpRequest(); +xhr.open('GET', '001-1.xml', false); +xhr.send(); +var passed = xhr.responseText == 'bar'; +postMessage(passed); \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/xhr/support/006-1.js b/testing/web-platform/tests/workers/semantics/xhr/support/006-1.js new file mode 100644 index 000000000..d446781eb --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/support/006-1.js @@ -0,0 +1,7 @@ +onconnect = function(e) { + var xhr = new XMLHttpRequest(); + xhr.open('GET', '001-1.xml', false); + xhr.send(); + var passed = xhr.responseText == 'bar'; + e.ports[0].postMessage(passed); +} \ No newline at end of file diff --git a/testing/web-platform/tests/workers/support/ErrorEvent-error.js b/testing/web-platform/tests/workers/support/ErrorEvent-error.js new file mode 100644 index 000000000..930b54c0d --- /dev/null +++ b/testing/web-platform/tests/workers/support/ErrorEvent-error.js @@ -0,0 +1,9 @@ +onerror = function(message, location, line, col, error) { + postMessage({ source: "onerror", value: error }); +} + +addEventListener("error", function(e) { + postMessage({ source: "event listener", value: e.error }); +}); + +throw "hello"; diff --git a/testing/web-platform/tests/workers/support/ErrorEvent.js b/testing/web-platform/tests/workers/support/ErrorEvent.js new file mode 100644 index 000000000..22ea6d4fb --- /dev/null +++ b/testing/web-platform/tests/workers/support/ErrorEvent.js @@ -0,0 +1,10 @@ +onmessage = function(evt) +{ + throw(new Error(evt.data)); +} + +onerror = function(message, location, line, col) +{ + postMessage( {"message": message, "filename": location, "lineno": line, "colno": col} ); + return false; // "not handled" so the error propagates up to the Worker object +} diff --git a/testing/web-platform/tests/workers/support/ImportScripts.js b/testing/web-platform/tests/workers/support/ImportScripts.js new file mode 100644 index 000000000..7f2a2bcb5 --- /dev/null +++ b/testing/web-platform/tests/workers/support/ImportScripts.js @@ -0,0 +1,9 @@ +try +{ + importScripts("WorkerBasic.js"); +} +catch(ex) +{ + result = "Fail"; + postMessage(result); +} diff --git a/testing/web-platform/tests/workers/support/ImportScriptsNetworkErr.js b/testing/web-platform/tests/workers/support/ImportScriptsNetworkErr.js new file mode 100644 index 000000000..8179c8b10 --- /dev/null +++ b/testing/web-platform/tests/workers/support/ImportScriptsNetworkErr.js @@ -0,0 +1,15 @@ +var result = "Fail"; + +try +{ + importScripts("NonExistentFile.js"); +} +catch(ex) +{ + if (ex.code != null && ex.code == ex.NETWORK_ERR) + { + result = "Pass"; + } +} + +postMessage(result); \ No newline at end of file diff --git a/testing/web-platform/tests/workers/support/Timer.js b/testing/web-platform/tests/workers/support/Timer.js new file mode 100644 index 000000000..a86a224db --- /dev/null +++ b/testing/web-platform/tests/workers/support/Timer.js @@ -0,0 +1,50 @@ +var count = 0; +var id; + +onmessage = function(evt) +{ + try + { + switch(evt.data) + { + case "TimeoutHandler": + count = 0; + id = setTimeout("TimeoutHandler()", 10); + postMessage('hello'); + break; + case "IntervalHandler": + count = 0; + id = setInterval("IntervalHandler()", 10); + postMessage('hello'); + break; + } + } + catch(ex) + { + postMessage("Fail"); + } +} + +function TimeoutHandler() +{ + count++; + postMessage("worker"); + + id = setTimeout("TimeoutHandler()", 10); + + if (count >= 2) + { + clearTimeout(id); + } +} + +function IntervalHandler() +{ + count++; + postMessage("worker"); + + if (count >= 2) + { + clearInterval(id); + } +} diff --git a/testing/web-platform/tests/workers/support/WorkerBasic.js b/testing/web-platform/tests/workers/support/WorkerBasic.js new file mode 100644 index 000000000..6bb6d32b1 --- /dev/null +++ b/testing/web-platform/tests/workers/support/WorkerBasic.js @@ -0,0 +1,7 @@ +var result = "Fail"; + +onmessage = function(evt) +{ + result = "Pass"; + postMessage(result); +} \ No newline at end of file diff --git a/testing/web-platform/tests/workers/support/WorkerClose.js b/testing/web-platform/tests/workers/support/WorkerClose.js new file mode 100644 index 000000000..81f99993d --- /dev/null +++ b/testing/web-platform/tests/workers/support/WorkerClose.js @@ -0,0 +1,5 @@ +onmessage = function(evt) +{ + postMessage(evt.data); + self.close(); +} \ No newline at end of file diff --git a/testing/web-platform/tests/workers/support/WorkerDataCloneErr.js b/testing/web-platform/tests/workers/support/WorkerDataCloneErr.js new file mode 100644 index 000000000..b7e8b0ae1 --- /dev/null +++ b/testing/web-platform/tests/workers/support/WorkerDataCloneErr.js @@ -0,0 +1,15 @@ +var result = "Fail"; + +try +{ + postMessage(navigator); +} +catch(ex) +{ + if(ex.code != null && ex.code == ex.DATA_CLONE_ERR) + { + result = "Pass"; + } +} + +postMessage(result); \ No newline at end of file diff --git a/testing/web-platform/tests/workers/support/WorkerLocation.js b/testing/web-platform/tests/workers/support/WorkerLocation.js new file mode 100644 index 000000000..a57e2fc66 --- /dev/null +++ b/testing/web-platform/tests/workers/support/WorkerLocation.js @@ -0,0 +1,12 @@ +var obj = new Object(); +obj.location = location.toString(); +obj.href = location.href; +obj.protocol = location.protocol; +obj.host = location.host; +obj.hostname = location.hostname; +obj.port = location.port; +obj.pathname = location.pathname; +obj.search = location.search; +obj.hash = location.hash; + +postMessage(obj); diff --git a/testing/web-platform/tests/workers/support/WorkerNavigator.js b/testing/web-platform/tests/workers/support/WorkerNavigator.js new file mode 100644 index 000000000..084e45b24 --- /dev/null +++ b/testing/web-platform/tests/workers/support/WorkerNavigator.js @@ -0,0 +1,8 @@ +var obj = new Object(); +obj.appName = navigator.appName; +obj.appVersion = navigator.appVersion; +obj.platform = navigator.platform; +obj.userAgent = navigator.userAgent; +obj.onLine = navigator.onLine; + +postMessage(obj); diff --git a/testing/web-platform/tests/workers/support/WorkerTerminate.js b/testing/web-platform/tests/workers/support/WorkerTerminate.js new file mode 100644 index 000000000..7c99e7ec5 --- /dev/null +++ b/testing/web-platform/tests/workers/support/WorkerTerminate.js @@ -0,0 +1,10 @@ +onmessage = function(evt) +{ + for (var i=0; true; i++) + { + if (i%1000 == 0) + { + postMessage(i); + } + } +} diff --git a/testing/web-platform/tests/workers/support/WorkerText.txt b/testing/web-platform/tests/workers/support/WorkerText.txt new file mode 100644 index 000000000..e4eeb5391 --- /dev/null +++ b/testing/web-platform/tests/workers/support/WorkerText.txt @@ -0,0 +1,2 @@ +var result = "Pass"; +postMessage(result); -- cgit v1.2.3