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

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

Issue 2617183002: Add more WebVR layout tests, adjust test format (Closed)
Patch Set: Add some missing catches for failed getVRDisplays 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..5379278dd31f7923d2ec88a66da4f5095e5b0be9 100644
--- a/third_party/WebKit/LayoutTests/vr/getVRDisplays_one_display.html
+++ b/third_party/WebKit/LayoutTests/vr/getVRDisplays_one_display.html
@@ -7,14 +7,25 @@
<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(1, displays.length);
+ let display = displays[0];
+ assert_equals(display.displayName, 'Google, Inc. Daydream View');
+ assert_true(display.capabilities.hasOrientation);
+ assert_equals(display.depthNear, 0.01);
bajones 2017/01/06 20:20:25 Again, let's try to consistently use approx_equals
bsheedy 2017/01/06 22:14:19 Done.
+ assert_equals(display.depthFar, 10000.0);
+ }, "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