Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: third_party/WebKit/LayoutTests/vr/getVRDisplays_detached.html

Issue 2703283003: Gracefully handle navigator.getVRDisplays() in detached contexts. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698