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

Side by Side 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="../resources/mojo-helpers.js"></script> 4 <script src="../resources/mojo-helpers.js"></script>
5 <script src="resources/fake-vr-displays.js"></script> 5 <script src="resources/fake-vr-displays.js"></script>
6 <script src="resources/mock-vr-service.js"></script> 6 <script src="resources/mock-vr-service.js"></script>
7 <script src="resources/test-constants.js"></script>
7 <script> 8 <script>
8 let fakeDisplays = fakeVRDisplays(); 9 let fakeDisplays = fakeVRDisplays();
9 10
10 vr_test((service) => { 11 vr_test( (t) => {
11 return navigator.getVRDisplays().then(devices => { 12 return navigator.getVRDisplays().then( (displays) => {
12 assert_true(devices != null); 13 t.step( () => {
13 assert_equals(2, devices.length); 14 assert_true(displays != null);
14 assert_equals(devices[0].displayName, 'Google, Inc. Daydream View'); 15 assert_equals(displays.length, 2);
15 assert_equals(devices[1].displayName, 'FakeVRDisplay'); 16 }, "getVRDisplays returned correct results");
16 assert_true(devices[0].capabilities.hasOrientation); 17 let pixel = displays[0];
17 assert_true(devices[1].capabilities.hasOrientation); 18 let fake = displays[1];
18 assert_true(devices[0].capabilities.canPresent); 19
19 assert_false(devices[1].capabilities.canPresent); 20 t.step( () => {
21 assert_equals(pixel.displayName, "Google, Inc. Daydream View");
22 assert_true(pixel.capabilities.hasOrientation);
23 assert_true(pixel.capabilities.canPresent);
24 assert_false(pixel.capabilities.hasPosition);
25 assert_false(pixel.capabilities.hasExternalDisplay);
26 assert_equals(pixel.capabilities.maxLayers, 1);
27 assert_approx_equals(pixel.depthNear, 0.01, FLOAT_EPSILON);
28 assert_approx_equals(pixel.depthFar, 10000.0, FLOAT_EPSILON);
29 }, "Pixel attributes are correct");
30
31 t.step( () => {
32 assert_equals(fake.displayName, "FakeVRDisplay");
33 assert_true(fake.capabilities.hasOrientation);
34 assert_false(fake.capabilities.canPresent);
35 assert_false(fake.capabilities.hasPosition);
36 assert_false(fake.capabilities.hasExternalDisplay);
37 assert_equals(fake.capabilities.maxLayers, 0);
38 assert_approx_equals(fake.depthNear, 0.01, FLOAT_EPSILON);
39 assert_approx_equals(fake.depthFar, 10000.0, FLOAT_EPSILON);
40 }, "Fake device attributes are correct");
41 }, (err) => {
42 t.step( () => {
43 assert_unreached("getVRDisplays rejected");
20 }); 44 });
21 }, [fakeDisplays['Pixel'], fakeDisplays['FakeMagicWindowOnly']], 45 }).then( () => {
22 'Test 2 VRDisplays'); 46 t.done();
47 });
48 }, [fakeDisplays["Pixel"], fakeDisplays["FakeMagicWindowOnly"]],
49 "Test that getVRDisplays properly returns two displays");
23 50
24 </script> 51 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698