Index: third_party/WebKit/LayoutTests/vr/getVRDisplays_detached.html |
diff --git a/third_party/WebKit/LayoutTests/vr/getVRDisplays_detached.html b/third_party/WebKit/LayoutTests/vr/getVRDisplays_detached.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b3d7079a0fbc6a5fed05ec1612e553808a169935 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/vr/getVRDisplays_detached.html |
@@ -0,0 +1,20 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<title>Detached use of navigator.getVRDisplays()</title> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+</head> |
+<body> |
+<iframe sandbox="allow-same-origin" id="subframe"></iframe> |
+<script> |
+test(() => { |
+ var nav = window.frames[0].navigator; |
+ document.getElementById("subframe").remove(); |
+ // A promise won't be rejected when in a detached context, |
+ // so the undefined value is returned. |
+ assert_equals(nav.getVRDisplays(), undefined); |
+}); |
+</script> |
+</body> |
+</html> |