Backed out changeset 06f41c22f3a6 (bug 1888460) for causing linux xpcshell failures...
[gecko.git] / dom / workers / test / importScripts_mixedcontent.html
blob2955fdc46e3023ebbc26d7acbd7ae416ab6fb655
1 <!--
2 Any copyright is dedicated to the Public Domain.
3 http://creativecommons.org/publicdomain/zero/1.0/
4 -->
5 <!DOCTYPE html>
6 <script>
7 function ok(cond, msg) {
8 window.parent.postMessage({status: "ok", data: cond, msg}, "*");
10 function finish() {
11 window.parent.postMessage({status: "done"}, "*");
14 function testSharedWorker() {
15 var sw = new SharedWorker("importForeignScripts_worker.js");
16 sw.port.onmessage = function(e) {
17 if (e.data == "finish") {
18 finish();
19 return;
21 ok(e.data === "good", "mixed content for shared workers is correctly blocked");
24 sw.onerror = function() {
25 ok(false, "Error on shared worker ");
28 sw.port.postMessage("start");
31 var worker = new Worker("importForeignScripts_worker.js");
33 worker.onmessage = function(e) {
34 if (e.data == "finish") {
35 testSharedWorker();
36 return;
38 ok(e.data === "good", "mixed content is correctly blocked");
41 worker.onerror = function() {
42 ok(false, "Error on worker");
45 worker.postMessage("start");
46 </script>