<!DOCTYPE HTML>
<html>
    <head>
        <script src="../../resources/testharness.js"></script>
        <script src="../../resources/testharnessreport.js"></script>
    </head>
    <body>
        <div id="navigateToSamePage"></div>
        <script>
promise_test((test) => {
    if (window.testRunner)
        testRunner.setUserMediaPermission(true);
    return navigator.mediaDevices.getUserMedia({audio:false, video:true}).then((stream) => {
        if (window.testRunner)
            testRunner.setUserMediaPermission(false);
        return navigator.mediaDevices.getUserMedia({audio:false, video:true});
    }).then(() => {
    }).then(() => {
        window.location = "#navigateToSamePage";
    }).then(() => {
        return navigator.mediaDevices.getUserMedia({audio:false, video:true});
    });
}, "Testing same page getUserMedia grant persistency after in page navigation");
        </script>
    </body>
</html>
