diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /testing/web-platform/tests/workers/semantics/encodings | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/workers/semantics/encodings')
12 files changed, 83 insertions, 0 deletions
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 @@ +<!doctype html> +<title>encoding, dedicated worker</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id=log></div> +<script> +async_test(function() { + var worker = new Worker('001.js'); + worker.onmessage = this.step_func(function(e) { + assert_equals(e.data, '\u00e5'); + this.done(); + }); +}); +</script>
\ 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 @@ +<!doctype html> +<title>encoding, shared worker</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id=log></div> +<script> +async_test(function() { + var worker = new SharedWorker('002.js', ''); + worker.port.onmessage = this.step_func(function(e) { + assert_equals(e.data, '\u00e5'); + this.done(); + }); +}); +</script> 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 @@ +<!doctype html> +<title>URL encoding, dedicated worker</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id=log></div> +<script> +async_test(function() { + var worker = new Worker('003.js'); + worker.onmessage = this.step_func(function(e) { + assert_true(e.data); + this.done(); + }); +}); +</script>
\ 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 @@ +<!doctype html> +<title>URL encoding, shared worker</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id=log></div> +<script> +async_test(function() { + var worker = new SharedWorker('004.js'); + worker.port.onmessage = this.step_func(function(e) { + assert_true(e.data); + this.done(); + }); +}); +</script>
\ 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(); |