summaryrefslogtreecommitdiffstats
path: root/dom/security/featurepolicy/test/mochitest/test_featureList.html
blob: 8a518da65386babab6ff511a601c45a745124aa4 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE HTML>
<html>
<head>
  <title>Test feature policy - list</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<iframe src="empty.html" id="ifr"></iframe>
<script type="text/javascript">

let supportedFeatures = [
  "autoplay",
  "camera",
  "encrypted-media",
  "fullscreen",
  "gamepad",
  "geolocation",
  "microphone",
  "midi",
  "payment",
  "publickey-credentials-create",
  "publickey-credentials-get",
  "storage-access",
  "display-capture",
  "document-domain",
  "speaker-selection",
  "vr",
  "web-share",
  "screen-wake-lock",
];

function checkFeatures(features) {
  features.forEach(feature => {
    ok(supportedFeatures.includes(feature), "Feature: " + feature);
  });
}

ok("featurePolicy" in document, "We have document.featurePolicy");
checkFeatures(document.featurePolicy.features());

let ifr = document.getElementById("ifr");
ok("featurePolicy" in ifr, "We have HTMLIFrameElement.featurePolicy");
checkFeatures(ifr.featurePolicy.features());

</script>
</body>
</html>