summaryrefslogtreecommitdiffstats
path: root/dom/worklet/tests/test_audioWorklet_insecureContext.html
blob: 3cbb419ac3991b593ab05453c4d8acdb6f668ef9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!DOCTYPE HTML>
<html>
<head>
  <title>Test for No AudioWorklet in insecure context</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <script type="application/javascript" src="common.js"></script>
</head>
<body>

<script type="application/javascript">

function configureTest() {
  return SpecialPowers.pushPrefEnv(
    {"set": [["dom.audioworklet.enabled", true],
             ["dom.worklet.enabled", true]]});
}

// This function is called into an iframe.
function runTestInIframe() {
  ok(!window.isSecureContext, "Test should run in an insecure context");
  var audioContext = new AudioContext();
  ok(!("audioWorklet" in audioContext),
     "AudioWorklet shouldn't be defined in AudioContext in a insecure context");
  SimpleTest.finish();
}
</script>
</body>
</html>