From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../tests/workers/semantics/encodings/001.html | 14 ++++ .../tests/workers/semantics/encodings/001.js | 1 + .../workers/semantics/encodings/001.js.headers | 1 + .../tests/workers/semantics/encodings/002.html | 14 ++++ .../tests/workers/semantics/encodings/002.js | 3 + .../workers/semantics/encodings/002.js.headers | 1 + .../tests/workers/semantics/encodings/003-1.py | 4 ++ .../tests/workers/semantics/encodings/003.html | 14 ++++ .../tests/workers/semantics/encodings/003.js | 5 ++ .../tests/workers/semantics/encodings/004.html | 14 ++++ .../tests/workers/semantics/encodings/004.js | 7 ++ .../workers/semantics/encodings/004.worker.js | 5 ++ .../semantics/interface-objects/001.worker.js | 83 +++++++++++++++++++++ .../semantics/interface-objects/002.worker.js | 43 +++++++++++ .../workers/semantics/interface-objects/003.any.js | 84 ++++++++++++++++++++++ .../workers/semantics/interface-objects/004.any.js | 38 ++++++++++ .../workers/semantics/multiple-workers/001.html | 23 ++++++ .../workers/semantics/multiple-workers/001.js | 11 +++ .../workers/semantics/multiple-workers/002.html | 21 ++++++ .../workers/semantics/multiple-workers/002.js | 1 + .../workers/semantics/multiple-workers/003.html | 16 +++++ .../workers/semantics/multiple-workers/003.js | 13 ++++ .../workers/semantics/multiple-workers/004-1.html | 7 ++ .../workers/semantics/multiple-workers/004-2.js | 6 ++ .../workers/semantics/multiple-workers/004.html | 37 ++++++++++ .../workers/semantics/multiple-workers/008-1.html | 8 +++ .../workers/semantics/multiple-workers/008.html | 19 +++++ .../workers/semantics/multiple-workers/008.js | 6 ++ .../semantics/multiple-workers/exposure.any.js | 11 +++ .../tests/workers/semantics/navigation/001-1.html | 15 ++++ .../tests/workers/semantics/navigation/001-1.js | 1 + .../tests/workers/semantics/navigation/001.html | 39 ++++++++++ .../tests/workers/semantics/navigation/002.html | 38 ++++++++++ .../workers/semantics/reporting-errors/001.html | 17 +++++ .../workers/semantics/reporting-errors/001.js | 28 ++++++++ .../workers/semantics/reporting-errors/002.html | 17 +++++ .../workers/semantics/reporting-errors/002.js | 34 +++++++++ .../workers/semantics/reporting-errors/003.html | 23 ++++++ .../workers/semantics/reporting-errors/003.js | 8 +++ .../workers/semantics/reporting-errors/004-1.html | 18 +++++ .../workers/semantics/reporting-errors/004.html | 26 +++++++ .../workers/semantics/reporting-errors/004.js | 6 ++ .../tests/workers/semantics/run-a-worker/001.html | 14 ++++ .../tests/workers/semantics/run-a-worker/001.js | 1 + .../tests/workers/semantics/run-a-worker/002.html | 14 ++++ .../tests/workers/semantics/run-a-worker/002.js | 4 ++ .../tests/workers/semantics/run-a-worker/003.html | 15 ++++ .../semantics/structured-clone/dedicated.html | 33 +++++++++ .../workers/semantics/structured-clone/shared.html | 37 ++++++++++ .../tests/workers/semantics/xhr/001-1.xml | 1 + .../tests/workers/semantics/xhr/001.html | 16 +++++ .../tests/workers/semantics/xhr/001.js | 13 ++++ .../tests/workers/semantics/xhr/002.html | 16 +++++ .../tests/workers/semantics/xhr/002.js | 9 +++ .../tests/workers/semantics/xhr/003.html | 16 +++++ .../tests/workers/semantics/xhr/003.js | 17 +++++ .../tests/workers/semantics/xhr/004.html | 16 +++++ .../tests/workers/semantics/xhr/004.js | 11 +++ .../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 ++ 63 files changed, 1068 insertions(+) create mode 100644 testing/web-platform/tests/workers/semantics/encodings/001.html create mode 100644 testing/web-platform/tests/workers/semantics/encodings/001.js create mode 100644 testing/web-platform/tests/workers/semantics/encodings/001.js.headers create mode 100644 testing/web-platform/tests/workers/semantics/encodings/002.html create mode 100644 testing/web-platform/tests/workers/semantics/encodings/002.js create mode 100644 testing/web-platform/tests/workers/semantics/encodings/002.js.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/003.js create mode 100644 testing/web-platform/tests/workers/semantics/encodings/004.html create mode 100644 testing/web-platform/tests/workers/semantics/encodings/004.js 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.any.js create mode 100644 testing/web-platform/tests/workers/semantics/interface-objects/004.any.js create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/001.html create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/001.js create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/002.html create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/002.js create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/003.html create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/003.js 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/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/multiple-workers/008.js create mode 100644 testing/web-platform/tests/workers/semantics/multiple-workers/exposure.any.js create mode 100644 testing/web-platform/tests/workers/semantics/navigation/001-1.html create mode 100644 testing/web-platform/tests/workers/semantics/navigation/001-1.js 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/001.js create mode 100644 testing/web-platform/tests/workers/semantics/reporting-errors/002.html create mode 100644 testing/web-platform/tests/workers/semantics/reporting-errors/002.js create mode 100644 testing/web-platform/tests/workers/semantics/reporting-errors/003.html create mode 100644 testing/web-platform/tests/workers/semantics/reporting-errors/003.js 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/reporting-errors/004.js 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/001.js 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/002.js 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/dedicated.html create mode 100644 testing/web-platform/tests/workers/semantics/structured-clone/shared.html 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/001.js create mode 100644 testing/web-platform/tests/workers/semantics/xhr/002.html create mode 100644 testing/web-platform/tests/workers/semantics/xhr/002.js create mode 100644 testing/web-platform/tests/workers/semantics/xhr/003.html create mode 100644 testing/web-platform/tests/workers/semantics/xhr/003.js create mode 100644 testing/web-platform/tests/workers/semantics/xhr/004.html create mode 100644 testing/web-platform/tests/workers/semantics/xhr/004.js 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 (limited to 'testing/web-platform/tests/workers/semantics') 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 0000000000..05ee5e006b --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/001.html @@ -0,0 +1,14 @@ + +encoding, dedicated worker + + +
+ \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/encodings/001.js b/testing/web-platform/tests/workers/semantics/encodings/001.js new file mode 100644 index 0000000000..03bc557c33 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/001.js @@ -0,0 +1 @@ +postMessage('Ã¥'); \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/encodings/001.js.headers b/testing/web-platform/tests/workers/semantics/encodings/001.js.headers new file mode 100644 index 0000000000..5614aaa7f0 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/001.js.headers @@ -0,0 +1 @@ +Content-Type: text/javascript; 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 0000000000..fecbffc18d --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/002.html @@ -0,0 +1,14 @@ + +encoding, shared worker + + +
+ diff --git a/testing/web-platform/tests/workers/semantics/encodings/002.js b/testing/web-platform/tests/workers/semantics/encodings/002.js new file mode 100644 index 0000000000..9dde7bbda9 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/002.js @@ -0,0 +1,3 @@ +onconnect = function(e) { + e.ports[0].postMessage('Ã¥'); +} \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/encodings/002.js.headers b/testing/web-platform/tests/workers/semantics/encodings/002.js.headers new file mode 100644 index 0000000000..5614aaa7f0 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/002.js.headers @@ -0,0 +1 @@ +Content-Type: text/javascript; 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 0000000000..4f5df2bb10 --- /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 u"PASS" if request.GET.first(b'x').decode('utf-8') == u'Ã¥' else u"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 0000000000..095320e4d1 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/003.html @@ -0,0 +1,14 @@ + +URL encoding, dedicated worker + + +
+ \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/encodings/003.js b/testing/web-platform/tests/workers/semantics/encodings/003.js new file mode 100644 index 0000000000..35bda8bba8 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/003.js @@ -0,0 +1,5 @@ +var xhr = new XMLHttpRequest(); +xhr.open('GET', '003-1.py?x=Ã¥', false); +xhr.send(); +var passed = xhr.responseText == 'PASS'; +postMessage(passed); \ No newline at end of file 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 0000000000..cd556b8190 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/004.html @@ -0,0 +1,14 @@ + +URL encoding, shared worker + + +
+ \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/encodings/004.js b/testing/web-platform/tests/workers/semantics/encodings/004.js new file mode 100644 index 0000000000..5146929a73 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/encodings/004.js @@ -0,0 +1,7 @@ +onconnect = function(e) { + var xhr = new XMLHttpRequest(); + xhr.open('GET', '003-1.py?x=Ã¥', false); + xhr.send(); + var passed = xhr.responseText == 'PASS'; + e.ports[0].postMessage(passed); +} \ 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 0000000000..28489a572b --- /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 0000000000..80fc597380 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/interface-objects/001.worker.js @@ -0,0 +1,83 @@ +importScripts("/resources/testharness.js"); +var expected = [ + // https://html.spec.whatwg.org/ + "WorkerGlobalScope", + "DedicatedWorkerGlobalScope", + "Worker", + "SharedWorker", + "MessagePort", + "MessageEvent", + "WorkerNavigator", + "MessageChannel", + "WorkerLocation", + "ImageData", + "ImageBitmap", + "CanvasGradient", + "CanvasPattern", + "CanvasPath", + "TextMetrics", + "Path2D", + "PromiseRejectionEvent", + "EventSource", + "BroadcastChannel", + // https://websockets.spec.whatwg.org/ + "WebSocket", + "CloseEvent", + // 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", + // https://webidl.spec.whatwg.org/ + "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 0000000000..d4f48354ed --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/interface-objects/002.worker.js @@ -0,0 +1,43 @@ +importScripts("/resources/testharness.js"); +var unexpected = [ + // https://html.spec.whatwg.org/ + "SharedWorkerGlobalScope", + "AbstractView", + "AbstractWorker", + "ApplicationCache", + "Location", + "Navigator", + "Audio", + "HTMLCanvasElement", + "Path", + "CanvasProxy", + "CanvasRenderingContext2D", + "DrawingStyle", + "BeforeUnloadEvent", + "PopStateEvent", + "HashChangeEvent", + "PageTransitionEvent", + // https://dom.spec.whatwg.org/ + "DOMImplementation", + // 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", + // https://w3c.github.io/webvtt/ + "VTTCue", + "VTTRegion", +]; +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.any.js b/testing/web-platform/tests/workers/semantics/interface-objects/003.any.js new file mode 100644 index 0000000000..4d595bccce --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/interface-objects/003.any.js @@ -0,0 +1,84 @@ +// META: global=sharedworker + +var expected = [ + // https://html.spec.whatwg.org/ + "ApplicationCache", + "WorkerGlobalScope", + "SharedWorkerGlobalScope", + "Worker", + "SharedWorker", + "MessagePort", + "MessageEvent", + "WorkerNavigator", + "MessageChannel", + "WorkerLocation", + "ImageData", + "ImageBitmap", + "CanvasGradient", + "CanvasPattern", + "CanvasPath", + "Path2D", + "PromiseRejectionEvent", + "EventSource", + "BroadcastChannel", + // https://websockets.spec.whatwg.org/ + "WebSocket", + "CloseEvent", + // 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", + // https://webidl.spec.whatwg.org/ + "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_true(expected[i] in self); + }, "The " + expected[i] + " interface object should be exposed"); +} diff --git a/testing/web-platform/tests/workers/semantics/interface-objects/004.any.js b/testing/web-platform/tests/workers/semantics/interface-objects/004.any.js new file mode 100644 index 0000000000..822379e2c9 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/interface-objects/004.any.js @@ -0,0 +1,38 @@ +// META: global=sharedworker + +var unexpected = [ + // https://html.spec.whatwg.org/ + "DedicatedWorkerGlobalScope", + "AbstractView", + "AbstractWorker", + "Location", + "Navigator", + "DOMImplementation", + "Audio", + "HTMLCanvasElement", + "Path", + "CanvasProxy", + "CanvasRenderingContext2D", + "DrawingStyle", + "PopStateEvent", + "HashChangeEvent", + "PageTransitionEvent", + // 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"); +} 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 0000000000..f9e2bbeaba --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/001.html @@ -0,0 +1,23 @@ + +dedicated and shared worker in same page + + +
+ \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/multiple-workers/001.js b/testing/web-platform/tests/workers/semantics/multiple-workers/001.js new file mode 100644 index 0000000000..6d51169dea --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/001.js @@ -0,0 +1,11 @@ +if ('onmessage' in self) { // dedicated worker + onmessage = function(e) { + postMessage(e.data); + } +} else { // shared worker + onconnect = function(e) { + e.ports[0].onmessage = function(e) { + this.postMessage(e.data); + } + } +} \ No newline at end of file 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 0000000000..aa01e361d8 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/002.html @@ -0,0 +1,21 @@ + +creating 3 sibling dedicated workers + + +
+ \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/multiple-workers/002.js b/testing/web-platform/tests/workers/semantics/multiple-workers/002.js new file mode 100644 index 0000000000..2318c2e267 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/002.js @@ -0,0 +1 @@ +postMessage(1); \ No newline at end of file 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 0000000000..f6e03c75f7 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/003.html @@ -0,0 +1,16 @@ + +creating 3 nested dedicated workers + + + +
+ diff --git a/testing/web-platform/tests/workers/semantics/multiple-workers/003.js b/testing/web-platform/tests/workers/semantics/multiple-workers/003.js new file mode 100644 index 0000000000..14a5a614b3 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/003.js @@ -0,0 +1,13 @@ +if (location.hash == '#1') { + var w2 = new Worker('003.js#2'); + w2.onmessage = function(e) { + postMessage('1'+e.data); + } +} else if (location.hash == '#2') { + var w3 = new Worker('003.js#3'); + w3.onmessage = function(e) { + postMessage('2'+e.data); + } +} else { + postMessage('3'); +} 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 0000000000..eac038c5be --- /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 0000000000..e59cd6927e --- /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 0000000000..552cc8a633 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/004.html @@ -0,0 +1,37 @@ + +shared worker with multiple documents + + + +
+ + + 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 0000000000..d19d7fa336 --- /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 0000000000..ee38d80866 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/008.html @@ -0,0 +1,19 @@ + +messagechannel in shared worker + + +
+ + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/multiple-workers/008.js b/testing/web-platform/tests/workers/semantics/multiple-workers/008.js new file mode 100644 index 0000000000..92593ebb86 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/008.js @@ -0,0 +1,6 @@ +var channel = new MessageChannel(); +var i = 0; +onconnect = function(e) { + i++; + e.ports[0].postMessage(1, [channel['port' + i]]); +} \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/multiple-workers/exposure.any.js b/testing/web-platform/tests/workers/semantics/multiple-workers/exposure.any.js new file mode 100644 index 0000000000..7e226a7333 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/multiple-workers/exposure.any.js @@ -0,0 +1,11 @@ +// META: global=window,worker + +test(() => { + const assert = "ServiceWorkerGlobalScope" in globalThis ? assert_equals : assert_not_equals; + assert(globalThis.Worker, undefined); +}, "Worker exposure"); + +test(() => { + const assert = globalThis.GLOBAL.isWindow() ? assert_not_equals : assert_equals; + assert(globalThis.SharedWorker, undefined); +}, "SharedWorker exposure"); 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 0000000000..c259c2c839 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/navigation/001-1.html @@ -0,0 +1,15 @@ + +001-1 + +link \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/navigation/001-1.js b/testing/web-platform/tests/workers/semantics/navigation/001-1.js new file mode 100644 index 0000000000..f62c365e32 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/navigation/001-1.js @@ -0,0 +1 @@ +setInterval(function() { postMessage(new Date()) }, 10) \ No newline at end of file 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 0000000000..f31c2590e5 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/navigation/001.html @@ -0,0 +1,39 @@ + + +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 0000000000..8ea98ef2d4 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/navigation/002.html @@ -0,0 +1,38 @@ + + +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 0000000000..d8b17289fe --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/reporting-errors/001.html @@ -0,0 +1,17 @@ + +shared worker, not handled + + +
+ diff --git a/testing/web-platform/tests/workers/semantics/reporting-errors/001.js b/testing/web-platform/tests/workers/semantics/reporting-errors/001.js new file mode 100644 index 0000000000..5736666cc3 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/reporting-errors/001.js @@ -0,0 +1,28 @@ +var port; +var timeout; +onerror = function(a,b,c,d,e) { + // will return undefined, thus the error is "not handled" + // so error should be reported to the user, but this test doesn't check + // that. + // just make sure that this method is invoked with five arguments + clearTimeout(timeout); + var log = ''; + if (arguments.length != 5) + log += 'got ' + arguments.length + ' arguments, expected 5. '; + if (typeof a != 'string') + log += 'first argument wasn\'t a string. '; + if (b != location.href) + log += 'second argument was ' + b + ', expected ' + location.href + '. '; + if (typeof c != 'number') + log += 'third argument wasn\'t a number. '; + if (typeof d != 'number') + log += 'fourth argument wasn\'t a number. '; + if (e != 42) + log += 'fifth argument wasn\'t the thrown exception. '; + port.postMessage(log); +} +onconnect = function (e) { + port = e.ports[0]; + timeout = setTimeout(function() { port.postMessage('self.onerror was not invoked'); }, 250); + throw 42; // will "report the error" +} 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 0000000000..4b322a5f07 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/reporting-errors/002.html @@ -0,0 +1,17 @@ + +shared worker, addEventListener + + +
+ diff --git a/testing/web-platform/tests/workers/semantics/reporting-errors/002.js b/testing/web-platform/tests/workers/semantics/reporting-errors/002.js new file mode 100644 index 0000000000..ff96922634 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/reporting-errors/002.js @@ -0,0 +1,34 @@ +var port; +var timeout; +addEventListener('error', function(e) { + // event is not canceled, thus the error is "not handled" + // so error should be reported to the user, but this test doesn't check + // that. + // just make sure that this event has the right properties + clearTimeout(timeout); + var log = ''; + if (!self.ErrorEvent || Object.getPrototypeOf(e) != ErrorEvent.prototype) + log += 'event should be an ErrorEvent. '; + if (e.bubbles) + log += 'event should not bubble. '; + if (!e.cancelable) + log += 'event should be cancelable. '; + if (!e.isTrusted) + log += 'event should be trusted. '; + if (typeof e.message != 'string') + log += 'message wasn\'t a string. '; + if (e.filename != location.href) + log += 'filename was ' + e.filename + ', expected ' + location.href + '. '; + if (typeof e.lineno != 'number') + log += 'lineno wasn\'t a number. '; + if (typeof e.colno != 'number') + log += 'colno argument wasn\'t a number. '; + if (e.error != 42) + log += 'fifth argument wasn\'t the thrown exception. '; + port.postMessage(log); +}, false); +onconnect = function (e) { + port = e.ports[0]; + timeout = setTimeout(function() { port.postMessage('No error event fired'); }, 250); + throw 42; // will "report the error" +} 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 0000000000..8ea59b8106 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/reporting-errors/003.html @@ -0,0 +1,23 @@ + +shared worker, no error event on worker or port + + +
+ diff --git a/testing/web-platform/tests/workers/semantics/reporting-errors/003.js b/testing/web-platform/tests/workers/semantics/reporting-errors/003.js new file mode 100644 index 0000000000..8a3390bb24 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/reporting-errors/003.js @@ -0,0 +1,8 @@ +onconnect = function (e) { + setTimeout(function() { e.ports[0].postMessage(''); }, 250); + y(); // will "report the error" + // onerror is null so it'll be "not handled", and the error should be + // reported to the user, although we don't test that here + // make sure we don't fire an error event on the message port or the + // SharedWorker object +} 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 0000000000..326e1399ec --- /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 0000000000..8516e52c6f --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/reporting-errors/004.html @@ -0,0 +1,26 @@ + +shared worker in two documents and window.onerror + + +
+ diff --git a/testing/web-platform/tests/workers/semantics/reporting-errors/004.js b/testing/web-platform/tests/workers/semantics/reporting-errors/004.js new file mode 100644 index 0000000000..a68d2ab01d --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/reporting-errors/004.js @@ -0,0 +1,6 @@ +var i = 0; +onconnect = function (e) { + i++; + setTimeout(function() { e.ports[0].postMessage(i); }, 250); + y(); // will "report the error" +} 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 0000000000..71e48c2771 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/run-a-worker/001.html @@ -0,0 +1,14 @@ + +worker global scope, dedicated worker + + +
+ \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/run-a-worker/001.js b/testing/web-platform/tests/workers/semantics/run-a-worker/001.js new file mode 100644 index 0000000000..33ed47f1b4 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/run-a-worker/001.js @@ -0,0 +1 @@ +postMessage(this === self); \ 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 0000000000..9487d886a6 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/run-a-worker/002.html @@ -0,0 +1,14 @@ + +worker global scope, shared worker + + +
+ \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/run-a-worker/002.js b/testing/web-platform/tests/workers/semantics/run-a-worker/002.js new file mode 100644 index 0000000000..627272aaef --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/run-a-worker/002.js @@ -0,0 +1,4 @@ +var passed = this === self; +onconnect = function(e) { + e.ports[0].postMessage(passed); +} \ 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 0000000000..e96c176f20 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/run-a-worker/003.html @@ -0,0 +1,15 @@ + +handling for 404 response + + + 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 0000000000..16b6be56f1 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/structured-clone/dedicated.html @@ -0,0 +1,33 @@ + +structured clone to dedicated worker + + + + + + +
+ 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 0000000000..eb85499fe2 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/structured-clone/shared.html @@ -0,0 +1,37 @@ + +structured clone to shared worker + + + + + + +
+ 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 0000000000..5d735bdf61 --- /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 0000000000..da59f5ac2d --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/001.html @@ -0,0 +1,16 @@ + +async XMLHttpRequest in dedicated worker + + +
+ + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/xhr/001.js b/testing/web-platform/tests/workers/semantics/xhr/001.js new file mode 100644 index 0000000000..1cbe98ba47 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/001.js @@ -0,0 +1,13 @@ +var xhr = new XMLHttpRequest(); +var log = ''; +xhr.onreadystatechange = function(e) { + if (this.readyState == 4) { + if (this.responseXML != null) + log += 'responseXML was not null. '; + if (this.responseText != 'foo') + log += 'responseText was ' + this.responseText + ', expected foo. '; + postMessage(log); + } +} +xhr.open('GET', '001-1.xml', true); +xhr.send(); \ 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 0000000000..60c0e161cc --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/002.html @@ -0,0 +1,16 @@ + +sync XMLHttpRequest in dedicated worker + + +
+ + \ No newline at end of file diff --git a/testing/web-platform/tests/workers/semantics/xhr/002.js b/testing/web-platform/tests/workers/semantics/xhr/002.js new file mode 100644 index 0000000000..68d7e91d45 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/002.js @@ -0,0 +1,9 @@ +var xhr = new XMLHttpRequest(); +var log = ''; +xhr.open('GET', '001-1.xml', false); +xhr.send(); +if (xhr.responseXML != null) + log += 'responseXML was not null. '; +if (xhr.responseText != 'foo') + log += 'responseText was ' + this.responseText + ', expected foo. '; +postMessage(log); \ 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 0000000000..e3ce36b82c --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/003.html @@ -0,0 +1,16 @@ + +async XMLHttpRequest in shared worker + + +
+ + diff --git a/testing/web-platform/tests/workers/semantics/xhr/003.js b/testing/web-platform/tests/workers/semantics/xhr/003.js new file mode 100644 index 0000000000..1a9c5a7ee8 --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/003.js @@ -0,0 +1,17 @@ +onconnect = function(e) { + var xhr = new XMLHttpRequest(); + var log = ''; + var port = e.ports[0]; + var postMessage = port.postMessage; + xhr.onreadystatechange = function(e) { + if (this.readyState == 4) { + if (this.responseXML != null) + log += 'responseXML was not null. '; + if (this.responseText && this.responseText != 'foo') + log += 'responseText was ' + this.responseText + ', expected foo. '; + postMessage.call(port, log); + } + } + xhr.open('GET', '001-1.xml', true); + xhr.send(); +} 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 0000000000..d11e3dbc1b --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/004.html @@ -0,0 +1,16 @@ + +sync XMLHttpRequest in shared worker + + +
+ + diff --git a/testing/web-platform/tests/workers/semantics/xhr/004.js b/testing/web-platform/tests/workers/semantics/xhr/004.js new file mode 100644 index 0000000000..1741c8d36a --- /dev/null +++ b/testing/web-platform/tests/workers/semantics/xhr/004.js @@ -0,0 +1,11 @@ +onconnect = function(e) { + var xhr = new XMLHttpRequest(); + var log = ''; + xhr.open('GET', '001-1.xml', false); + xhr.send(); + if (xhr.responseXML != null) + log += 'responseXML was not null. '; + if (xhr.responseText != 'foo') + log += 'responseText was ' + xhr.responseText + ', expected foo. '; + e.ports[0].postMessage(log); +} 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 0000000000..84abdb0c42 --- /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 0000000000..7411b4baef --- /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 0000000000..ecea58a935 --- /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 0000000000..45f6519a21 --- /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 0000000000..d446781eb7 --- /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 -- cgit v1.2.3