summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope')
-rw-r--r--testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope/name/getting.html34
-rw-r--r--testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope/name/setting.html25
-rw-r--r--testing/web-platform/tests/workers/interfaces/SharedWorkerGlobalScope/onconnect.html39
3 files changed, 98 insertions, 0 deletions
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 @@
+<!--
+addEventListener('connect', function(e) {
+ var passed;
+ switch (location.hash) {
+ case '#1': passed = name == ''; break;
+ case '#2': passed = name == 'a'; break;
+ case '#3': passed = name == '0'; break;
+ }
+ e.ports[0].postMessage(passed);
+}, false);
+/*
+-->
+<!doctype html>
+<title>getting name</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var tests = [['#1', ''], ['#2', 'a'], ['#3', -0]];
+tests.forEach(function(t) {
+ async_test(function() {
+ var w = new SharedWorker(t[0], t[1]);
+ w.port.onmessage = this.step_func(function(e) {
+ assert_true(e.data);
+ this.done();
+ });
+ });
+});
+</script>
+<!--
+*/
+//-->
+
+
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 @@
+<!--
+addEventListener('connect', function(e) {
+ name = 1;
+ e.ports[0].postMessage(name);
+}, false);
+/*
+-->
+<!doctype html>
+<title>setting name</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+async_test(function() {
+ var w1 = new SharedWorker('#1', 'x');
+ w1.port.addEventListener('message', this.step_func(function(e) {
+ assert_equals(e.data, 'x');
+ this.done();
+ }), false);
+ w1.port.start();
+});
+</script>
+<!--
+*/
+//-->
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 @@
+<!--
+var results = [];
+try {
+ self.onconnect = 1;
+ results.push(String(onconnect));
+} catch(e) {
+ results.push(''+e);
+}
+try {
+ self.onconnect = {handleEvent:function(){}};
+ results.push(String(onconnect));
+} catch(e) {
+ results.push(''+e);
+}
+var f = function(e) {
+ results.push(e.data);
+ e.ports[0].postMessage(results);
+};
+onconnect = f;
+results.push(typeof onconnect);
+/*
+-->
+<!doctype html>
+<title>onconnect</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+async_test(function() {
+ var w1 = new SharedWorker('#', '');
+ w1.port.addEventListener('message', this.step_func(function(e) {
+ assert_array_equals(e.data, ['null', 'null', 'function', '']);
+ }), false);
+ w1.port.start();
+});
+</script>
+<!--
+*/
+//-->