summaryrefslogtreecommitdiffstats
path: root/dom/media/webrtc/tests/mochitests/test_enumerateDevices_iframe_pre_gum.html
blob: f2dc2d1f65bcb01a55251ba309d6b260df9628d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE HTML>
<html>
<body>
<pre id="test">
<script type="application/javascript">
/**
  Runs inside iframe in test_enumerateDevices_legacy.html.
*/

const pushPrefs = (...p) => SpecialPowers.pushPrefEnv({set: p});

(async () => {
  await pushPrefs(["media.navigator.streams.fake", true]);

  const devices = await navigator.mediaDevices.enumerateDevices();
  parent.postMessage(JSON.stringify(devices), "https://example.com:443");

})().catch(e => setTimeout(() => { throw e; }));
</script>
</pre>
</body>
</html>