summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/workers/semantics/encodings
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/workers/semantics/encodings')
-rw-r--r--testing/web-platform/tests/workers/semantics/encodings/001.html21
-rw-r--r--testing/web-platform/tests/workers/semantics/encodings/001.html.headers1
-rw-r--r--testing/web-platform/tests/workers/semantics/encodings/002.html23
-rw-r--r--testing/web-platform/tests/workers/semantics/encodings/002.html.headers1
-rw-r--r--testing/web-platform/tests/workers/semantics/encodings/003-1.py4
-rw-r--r--testing/web-platform/tests/workers/semantics/encodings/003.html26
-rw-r--r--testing/web-platform/tests/workers/semantics/encodings/004.html27
-rw-r--r--testing/web-platform/tests/workers/semantics/encodings/004.worker.js5
8 files changed, 108 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 000000000..0ebec0b03
--- /dev/null
+++ b/testing/web-platform/tests/workers/semantics/encodings/001.html
@@ -0,0 +1,21 @@
+<!--
+postMessage('Ã¥');
+/*
+-->
+<!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('#');
+ 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.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 @@
+<!--
+onconnect = function(e) {
+ e.ports[0].postMessage('Ã¥');
+}
+/*
+-->
+<!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('#', '');
+ worker.port.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/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 @@
+<!--
+var xhr = new XMLHttpRequest();
+xhr.open('GET', '003-1.py?x=Ã¥', false);
+xhr.send();
+var passed = xhr.responseText == 'PASS';
+postMessage(passed);
+
+/*
+-->
+<!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('#');
+ worker.onmessage = this.step_func(function(e) {
+ assert_true(e.data);
+ this.done();
+ });
+});
+</script>
+<!--
+*/
+//-->
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 @@
+<!--
+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);
+}
+/*
+-->
+<!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('#');
+ 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.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();