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

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

Issue 2623613002: Reland 2617183002 without offending tests (Closed)
Patch Set: Created 3 years, 11 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_two_display.html
diff --git a/third_party/WebKit/LayoutTests/vr/getVRDisplays_two_display.html b/third_party/WebKit/LayoutTests/vr/getVRDisplays_two_display.html
index c88611165aca3a0d39f93eacc80421e4e83c8dd5..1b144d6452a05c2eb13a0a0c9b14b62cbac63c4b 100644
--- a/third_party/WebKit/LayoutTests/vr/getVRDisplays_two_display.html
+++ b/third_party/WebKit/LayoutTests/vr/getVRDisplays_two_display.html
@@ -4,21 +4,48 @@
<script src="../resources/mojo-helpers.js"></script>
<script src="resources/fake-vr-displays.js"></script>
<script src="resources/mock-vr-service.js"></script>
+<script src="resources/test-constants.js"></script>
<script>
let fakeDisplays = fakeVRDisplays();
-vr_test((service) => {
- return navigator.getVRDisplays().then(devices => {
- assert_true(devices != null);
- assert_equals(2, devices.length);
- assert_equals(devices[0].displayName, 'Google, Inc. Daydream View');
- assert_equals(devices[1].displayName, 'FakeVRDisplay');
- assert_true(devices[0].capabilities.hasOrientation);
- assert_true(devices[1].capabilities.hasOrientation);
- assert_true(devices[0].capabilities.canPresent);
- assert_false(devices[1].capabilities.canPresent);
+vr_test( (t) => {
+ return navigator.getVRDisplays().then( (displays) => {
+ t.step( () => {
+ assert_true(displays != null);
+ assert_equals(displays.length, 2);
+ }, "getVRDisplays returned correct results");
+ let pixel = displays[0];
+ let fake = displays[1];
+
+ t.step( () => {
+ assert_equals(pixel.displayName, "Google, Inc. Daydream View");
+ assert_true(pixel.capabilities.hasOrientation);
+ assert_true(pixel.capabilities.canPresent);
+ assert_false(pixel.capabilities.hasPosition);
+ assert_false(pixel.capabilities.hasExternalDisplay);
+ assert_equals(pixel.capabilities.maxLayers, 1);
+ assert_approx_equals(pixel.depthNear, 0.01, FLOAT_EPSILON);
+ assert_approx_equals(pixel.depthFar, 10000.0, FLOAT_EPSILON);
+ }, "Pixel attributes are correct");
+
+ t.step( () => {
+ assert_equals(fake.displayName, "FakeVRDisplay");
+ assert_true(fake.capabilities.hasOrientation);
+ assert_false(fake.capabilities.canPresent);
+ assert_false(fake.capabilities.hasPosition);
+ assert_false(fake.capabilities.hasExternalDisplay);
+ assert_equals(fake.capabilities.maxLayers, 0);
+ assert_approx_equals(fake.depthNear, 0.01, FLOAT_EPSILON);
+ assert_approx_equals(fake.depthFar, 10000.0, FLOAT_EPSILON);
+ }, "Fake device attributes are correct");
+ }, (err) => {
+ t.step( () => {
+ assert_unreached("getVRDisplays rejected");
});
-}, [fakeDisplays['Pixel'], fakeDisplays['FakeMagicWindowOnly']],
-'Test 2 VRDisplays');
+ }).then( () => {
+ t.done();
+ });
+}, [fakeDisplays["Pixel"], fakeDisplays["FakeMagicWindowOnly"]],
+"Test that getVRDisplays properly returns two displays");
</script>

Powered by Google App Engine
This is Rietveld 408576698