blob: 279a9ef75ffc2323ecba09b1cde339dd1f8cd37e [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="../vr/resources/fake-vr-displays.js"></script>
<script src="file:///gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script>
<script src="file:///gen/device/vr/vr_service.mojom.js"></script>
<script src="../vr/resources/mock-vr-service.js"></script>
<script src="../vr/resources/test-constants.js"></script>
<script>
let fakeDisplays = fakeVRDisplays();
vr_test( (t) => {
// TODO(offenwanger) When we know how to we want to select which device to
// return, update this test.
return navigator.xr.requestDevice().then( (device) => {
t.step( () => {
assert_true(device != null);
}, "requestDevice returned result");
t.step( () => {
assert_false(device.external);
}, "Attribute for device is correct");
}, (err) => {
t.step( () => {
assert_unreached("requestDevice rejected");
});
}).then( () => {
t.done();
});
}, [fakeDisplays["Pixel"], fakeDisplays["FakeMagicWindowOnly"]],
"navigator.xr.requestDevice properly returns one device when there are two");
</script>