1
0
Fork 0
firefox/testing/web-platform/tests/mediacapture-streams/crashtests/enumerateDevices-after-discard-1.https.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

18 lines
589 B
HTML

<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>