diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/secure-contexts/support | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-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/secure-contexts/support')
7 files changed, 86 insertions, 0 deletions
diff --git a/testing/web-platform/tests/secure-contexts/support/dedicated-worker-script.js b/testing/web-platform/tests/secure-contexts/support/dedicated-worker-script.js new file mode 100644 index 000000000..69ffdf344 --- /dev/null +++ b/testing/web-platform/tests/secure-contexts/support/dedicated-worker-script.js @@ -0,0 +1 @@ +postMessage(isSecureContext); diff --git a/testing/web-platform/tests/secure-contexts/support/https-subframe-dedicated.html b/testing/web-platform/tests/secure-contexts/support/https-subframe-dedicated.html new file mode 100644 index 000000000..85005df29 --- /dev/null +++ b/testing/web-platform/tests/secure-contexts/support/https-subframe-dedicated.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<script src="../server-locations.sub.js"></script> +<script> + var w1 = new Worker(http_dir + "support/dedicated-worker-script.js"); + w1.onmessage = function(e) { + parent.postMessage({ type: "http", error: false, + isSecureContext: e.data }, "*"); + }; + w1.onerror = function(e) { + parent.postMessage({ type: "http", error: true }, "*"); + }; + + var w2 = new Worker(https_dir + "support/dedicated-worker-script.js"); + w2.onmessage = function(e) { + parent.postMessage({ type: "https", error: false, + isSecureContext: e.data }, "*"); + }; + w2.onerror = function(e) { + parent.postMessage({ type: "https", error: true }, "*"); + } +</script> diff --git a/testing/web-platform/tests/secure-contexts/support/https-subframe-shared.html b/testing/web-platform/tests/secure-contexts/support/https-subframe-shared.html new file mode 100644 index 000000000..5ae7cde5b --- /dev/null +++ b/testing/web-platform/tests/secure-contexts/support/https-subframe-shared.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<script> + try { + var w = new SharedWorker("shared-worker-script.js"); + w.port.onmessage = function(e) { + parent.postMessage({ type: "shared", error: false, exception: false, + isSecureContext: e.data }, "*"); + }; + w.onerror = function(e) { + parent.postMessage({ type: "shared", error: true, exception: false }, + "*"); + } + w.port.start(); + } catch (e) { + parent.postMessage({ type: "shared", exception: true }, "*"); + } + + try { + var w = new SharedWorker("parent-shared-worker-script.js"); + w.port.onmessage = function(e) { + parent.postMessage({ type: "nested", error: false, exception: false, + isSecureContext: e.data }, "*"); + }; + w.onerror = function(e) { + parent.postMessage({ type: "nested", error: true, exception: false }, + "*"); + } + w.port.start(); + } catch (e) { + parent.postMessage({ type: "nested", exception: true }, "*"); + } +</script> diff --git a/testing/web-platform/tests/secure-contexts/support/parent-dedicated-worker-script.js b/testing/web-platform/tests/secure-contexts/support/parent-dedicated-worker-script.js new file mode 100644 index 000000000..a8447552d --- /dev/null +++ b/testing/web-platform/tests/secure-contexts/support/parent-dedicated-worker-script.js @@ -0,0 +1,4 @@ +var w = new Worker("dedicated-worker-script.js"); +w.onmessage = function (e) { + postMessage(e.data); +} diff --git a/testing/web-platform/tests/secure-contexts/support/parent-shared-worker-script.js b/testing/web-platform/tests/secure-contexts/support/parent-shared-worker-script.js new file mode 100644 index 000000000..7f999f938 --- /dev/null +++ b/testing/web-platform/tests/secure-contexts/support/parent-shared-worker-script.js @@ -0,0 +1,8 @@ +addEventListener("connect", function (e) { + var port = e.ports[0]; + port.start(); + var w = new Worker("dedicated-worker-script.js"); + w.onmessage = function (e) { + port.postMessage(e.data); + } +}); diff --git a/testing/web-platform/tests/secure-contexts/support/shared-worker-insecure-popup.html b/testing/web-platform/tests/secure-contexts/support/shared-worker-insecure-popup.html new file mode 100644 index 000000000..740679dc4 --- /dev/null +++ b/testing/web-platform/tests/secure-contexts/support/shared-worker-insecure-popup.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<script src="../server-locations.sub.js"></script> +<body> + <script> + var url = self[location.search.substr(1)] + "support/https-subframe-shared.html"; + onmessage = function(e) { + var data = e.data; + data.fromPopup = true; + opener.postMessage(data, "*"); + } + var ifr = document.createElement("iframe"); + ifr.src = url; + document.body.appendChild(ifr); + </script> +</body> diff --git a/testing/web-platform/tests/secure-contexts/support/shared-worker-script.js b/testing/web-platform/tests/secure-contexts/support/shared-worker-script.js new file mode 100644 index 000000000..faed70a5c --- /dev/null +++ b/testing/web-platform/tests/secure-contexts/support/shared-worker-script.js @@ -0,0 +1,5 @@ +addEventListener("connect", function (e) { + var port = e.ports[0]; + port.start(); + port.postMessage(isSecureContext); +}); |