41 lines
1.2 KiB
HTML
41 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script>
|
|
if (window.testRunner) {
|
|
testRunner.dumpAsText();
|
|
testRunner.waitUntilDone();
|
|
}
|
|
function test() {
|
|
if (window.localStorage.getItem("gum-after-reload") == null) {
|
|
window.localStorage.setItem("gum-after-reload", "true")
|
|
if (window.testRunner)
|
|
testRunner.setUserMediaPermission(true);
|
|
navigator.mediaDevices.getUserMedia({audio:true, video:true}).then(() => {
|
|
internals.forceReload(true);
|
|
});
|
|
} else {
|
|
window.localStorage.clear();
|
|
if (window.testRunner)
|
|
testRunner.setUserMediaPermission(false);
|
|
navigator.mediaDevices.getUserMedia({audio:true, video:true}).then(() => {i
|
|
result.innerHTML = "FAIL";
|
|
if (window.testRunner)
|
|
testRunner.notifyDone();
|
|
}, () => {
|
|
result.innerHTML = "PASS";
|
|
if (window.testRunner)
|
|
testRunner.notifyDone();
|
|
});
|
|
};
|
|
}
|
|
</script>
|
|
</head>
|
|
<body onload="setTimeout(test, 0);">
|
|
<div>In case of reload, getUserMedia should not be allowed based on previous getUserMedia calls but only according client logic</div>
|
|
<div id="result"></div>
|
|
</body>
|
|
</html>
|
|
|
|
|