<!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:true, video:false}).then(assert_unreached, (e) => {
        assert_equals(e.name, "NotAllowedError");
        if (window.testRunner)
            testRunner.setUserMediaPermission(true);
        return navigator.mediaDevices.getUserMedia({audio:true, video:false}).then(assert_unreached, (e) => {
            assert_equals(e.name, "NotAllowedError");
        });
    }).then(() => {
        return navigator.mediaDevices.getUserMedia({audio:false, video:true});
    }).then(() => {
        return navigator.mediaDevices.getUserMedia({audio:true, video:false}).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 video denied");
        </script>
    </body>
</html>
