summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/mediacapture-streams/crashtests/enumerateDevices-after-discard-1.https.html
blob: d1f4bab1458147a71ffa757b28653ff7e3285c81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<html class="test-wait">
<head>
  <title>
    Test enumerateDevices() calls either side of browsing context discard
  </title>
</head>
<script>
  const frame = document.createElement('frame');
  document.documentElement.appendChild(frame);
  const devices = frame.contentWindow.navigator.mediaDevices;
  devices.enumerateDevices();
  frame.remove();
  devices.enumerateDevices();
  // Wait long enough to expect the async enumerateDevices() code to complete.
  navigator.mediaDevices.enumerateDevices().then(
    () => document.documentElement.removeAttribute("class"));
</script>
</html>