1
0
Fork 0
firefox/testing/web-platform/tests/screen-capture/getallscreensmedia-exposure.tentative.https.window.js
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
765 B
JavaScript

async_test(t => {
const i = document.createElement('iframe');
i.src = "/common/blank.html";
i.onload = t.step_func_done(_ => {
assert_equals('undefined', typeof i.contentWindow.navigator.mediaDevices.getAllScreensMedia);
});
document.body.appendChild(i);
}, "No CSP, no exposure.");
async_test(t => {
const i = document.createElement('iframe');
i.src = "/content-security-policy/support/echo-policy.py?policy=" +
encodeURIComponent("script-src 'none'; object-src 'none'; base-uri 'none'; require-trusted-types-for 'script'");
i.onload = t.step_func_done(_ => {
assert_equals("undefined", typeof i.contentWindow.navigator.mediaDevices.getAllScreensMedia);
});
document.body.appendChild(i);
}, "Strict CSP + TT, no exposure.");