blob: e90a33dab484b3d977fa16665a74a4745a5514f6 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>Detached use of navigator.xr</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
</head>
<body>
<iframe sandbox="allow-same-origin" id="subframe"></iframe>
<script>
promise_test((t) => {
var nav_xr = window.frames[0].navigator.xr;
document.getElementById("subframe").remove();
return promise_rejects(t, "InvalidStateError", nav_xr.supportsSessionMode('inline'))
.then(() => promise_rejects(t, "InvalidStateError", nav_xr.requestSession({ mode: 'inline' })));
}, "Check that navigator.xr.supportsSessionMode and navigator.xr.requestSession reject on a detached navigator.");
</script>
</body>
</html>