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

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

Issue 2599113002: Add the first layout tests for WebVR to test navigator.getVRDisplays with mocked vr_service mojo in… (Closed)
Patch Set: Created 4 years 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/vrdisplays_test.html
diff --git a/third_party/WebKit/LayoutTests/vr/vrdisplays_test.html b/third_party/WebKit/LayoutTests/vr/vrdisplays_test.html
new file mode 100644
index 0000000000000000000000000000000000000000..47709b84efdb6bd9b2ec5190ff246a590184c477
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/vr/vrdisplays_test.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../resources/mojo-helpers.js"></script>
+<script src="resources/fake-vr-displays.js"></script>
+<script src="resources/mock-vr-service.js"></script>
+<script>
+
+vr_test(() => {
+ return navigator.getVRDisplays().then(displays => {
+ assert_true(displays != null);
+ assert_equals(1, displays.length);
+ assert_equals(displays[0].displayName, 'FakeVRDevice');
+ assert_true(displays[0].capabilities.hasOrientation);
+ assert_true(displays != null);
+ });
+}, fakeVRDisplays(), 'test 1 VRDisplay');
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698