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

Unified Diff: third_party/WebKit/LayoutTests/vr/stageParameters_match.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/stageParameters_match.html
diff --git a/third_party/WebKit/LayoutTests/vr/stageParameters_match.html b/third_party/WebKit/LayoutTests/vr/stageParameters_match.html
new file mode 100644
index 0000000000000000000000000000000000000000..27bc5132f708c2cdd8c54c6bae082032d76e6321
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/vr/stageParameters_match.html
@@ -0,0 +1,47 @@
+<!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 src="resources/test-constants.js"></script>
+<canvas id="webgl-canvas"></canvas>
+<script src="resources/presentation-setup.js"></script>
+<script>
+let fakeDisplays = fakeVRDisplays();
+let fakeDisplay = fakeDisplays["FakeRoomScale"];
+
+vr_test( (t) => {
+ return navigator.getVRDisplays().then( (displays) => {
+ let display = displays[0];
+ let expectedParams = fakeDisplay.stageParameters;
+ let actualParams = display.stageParameters;
+
+ t.step( () => {
+ assert_true(display.capabilities.hasExternalDisplay);
+ assert_true(display.capabilities.hasPosition);
+ assert_equals(expectedParams.standingTransform.length,
+ actualParams.sittingToStandingTransform.length);
+ assert_equals(expectedParams.standingTransform.length, 16);
+ for (let i = 0; i < expectedParams.standingTransform.length; i++) {
+ assert_approx_equals(expectedParams.standingTransform[i],
+ actualParams.sittingToStandingTransform[i], FLOAT_EPSILON);
+ }
+
+ assert_approx_equals(expectedParams.sizeX, actualParams.sizeX,
+ FLOAT_EPSILON);
+ assert_approx_equals(expectedParams.sizeZ, actualParams.sizeZ,
+ FLOAT_EPSILON);
+ }, "Expected and actual values match");
+
+ t.done();
+ }, (err) => {
+ t.step( () => {
+ assert_unreached(err);
+ }, "getVRDisplays rejected");
+ t.done();
+ });
+}, [fakeDisplay],
+"Test actual stageParameters match expected parameters");
+
+</script>
« no previous file with comments | « third_party/WebKit/LayoutTests/vr/resources/test-constants.js ('k') | third_party/WebKit/Source/modules/vr/VRDisplay.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698