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

Unified Diff: third_party/WebKit/LayoutTests/vr/getVRDisplays_one_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_one_display.html
diff --git a/third_party/WebKit/LayoutTests/vr/getVRDisplays_one_display.html b/third_party/WebKit/LayoutTests/vr/getVRDisplays_one_display.html
index e2e5d3d49174b5e1b88f20c3b3a6f12095ab44ee..ee9fd9a3ad086aee8de88ad3ff5369317c8f8cbf 100644
--- a/third_party/WebKit/LayoutTests/vr/getVRDisplays_one_display.html
+++ b/third_party/WebKit/LayoutTests/vr/getVRDisplays_one_display.html
@@ -4,17 +4,29 @@
<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(1, devices.length);
- assert_equals(devices[0].displayName, 'Google, Inc. Daydream View');
- assert_true(devices[0].capabilities.hasOrientation);
- assert_true(devices != null);
+vr_test( (t) => {
+ return navigator.getVRDisplays().then( (displays) => {
+ t.step( () => {
+ assert_true(displays != null);
+ assert_equals(displays.length, 1);
+ let display = displays[0];
+ assert_equals(display.displayName, 'Google, Inc. Daydream View');
+ assert_true(display.capabilities.hasOrientation);
+ assert_approx_equals(display.depthNear, 0.01, FLOAT_EPSILON);
+ assert_approx_equals(display.depthFar, 10000.0, FLOAT_EPSILON);
+ }, "getVRDisplays returned correct results");
+ }, (err) => {
+ t.step( () => {
+ assert_unreached("getVRDisplays rejected");
});
-}, [fakeDisplays['Pixel']], 'test 1 VRDisplay');
+ }).then( () => {
+ t.done();
+ });
+}, [fakeDisplays["Pixel"]],
+"WebVR properly returns a single display");
</script>

Powered by Google App Engine
This is Rietveld 408576698