blob: e3c508293146d4bc7b887d70b1619722201e6395 [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<script>
promise_test((test) => {
if (window.testRunner)
testRunner.setUserMediaPermission(false);
return navigator.mediaDevices.getUserMedia({audio:false, video:true}).then(assert_unreached, (e) => {
assert_equals(e.name, "NotAllowedError");
if (window.testRunner)
testRunner.setUserMediaPermission(true);
return navigator.mediaDevices.getUserMedia({audio:false, video:true}).then(assert_unreached, (e) => {
assert_equals(e.name, "NotAllowedError");
});
}).then(() => {
return navigator.mediaDevices.getUserMedia({audio:true, video:false});
}).then(() => {
return navigator.mediaDevices.getUserMedia({audio:false, video:true}).then(assert_unreached, (e) => {
assert_equals(e.name, "NotAllowedError");
});
}).then(() => {
return navigator.mediaDevices.getUserMedia({audio:true, video:true}).then(assert_unreached, (e) => {
assert_equals(e.name, "NotAllowedError");
});
});
}, "Testing same page getUserMedia deny persistency with audio denied");
</script>
</body>
</html>