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

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

Powered by Google App Engine
This is Rietveld 408576698