blob: b2e52affedee41f6eb2ad4f999fd31b65c881cc6 [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>
//This test ensures that if a navigator.xr gets called on a detached navigator the renderer does not crash.
test(function() {
var nav = window.frames[0].navigator;
document.getElementById("subframe").remove();
// If all goes well, nav.xr should just be null, otherwise the renderer will crash.
assert_equals(nav.xr, null);
}, "navigator.xr does not crash");
</script>
</body>
</html>