summaryrefslogtreecommitdiffstats
path: root/dom/workers/test/serviceworkers/register_https.html
diff options
context:
space:
mode:
Diffstat (limited to 'dom/workers/test/serviceworkers/register_https.html')
-rw-r--r--dom/workers/test/serviceworkers/register_https.html21
1 files changed, 21 insertions, 0 deletions
diff --git a/dom/workers/test/serviceworkers/register_https.html b/dom/workers/test/serviceworkers/register_https.html
new file mode 100644
index 000000000..d14d8c380
--- /dev/null
+++ b/dom/workers/test/serviceworkers/register_https.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<script>
+function ok(condition, message) {
+ parent.postMessage({type: "ok", status: condition, msg: message}, "*");
+}
+
+function done() {
+ parent.postMessage({type: "done"}, "*");
+}
+
+ok(location.protocol == "https:", "We should be loaded from HTTPS");
+
+navigator.serviceWorker.register("empty.js", {scope: "register-https"})
+ .then(reg => {
+ ok(false, "Registration should fail");
+ done();
+ }).catch(err => {
+ ok(err.name === "SecurityError", "Registration should fail with SecurityError");
+ done();
+ });
+</script>