blob: d20d7927c04e6fce878e3242531b7b6491f5405a [file] [log] [blame]
<!DOCTYPE html>
<meta charset="utf-8">
<!-- Generate token with the command:
generate_token.py http://127.0.0.1:8000 WebVR1.1M62 --expire-timestamp=2000000000
To test whether the token is working, run virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/xr tests.
-->
<title>WebVR1.1M62 - interfaces exposed by origin trial</title>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../../resources/origin-trials-helper.js"></script>
<script>
const token="AjBmNGyEfNhgv1i84o2MDXzBna5hynT2UdRWh24E6smvQuM6lTjdHiORSsixiR6wo8A4AZofrxgIT6RYIjwg2AMAAABTeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiV2ViVlIxLjFNNjIiLCAiZXhwaXJ5IjogMjAwMDAwMDAwMH0=";
properties_to_check = {
'Gamepad': ['pose', 'hand', 'displayId'],
'GamepadButton': ['touched'],
};
interfaces_to_check = [
'GamepadPose'
];
// Skip this test if flags are not set properly.
if(!self.internals.runtimeFlags.gamepadExtensionsEnabled) {
test(t => {
OriginTrialsHelper.check_properties_missing(this, properties_to_check);
}, "Additional Gamepad Extensions properties are not available without a token.");
test(t => {
OriginTrialsHelper.check_interfaces_missing(this, interfaces_to_check);
}, "Additional Gamepad Extensions interfaces are not available without a token.");
}
OriginTrialsHelper.add_token(token);
test(t => {
OriginTrialsHelper.check_properties(this, properties_to_check);
}, 'Additional Gamepad Extensions properties are available.');
test(t => {
OriginTrialsHelper.check_interfaces(this, interfaces_to_check);
// Check the properties of the interfaces_to_check.
OriginTrialsHelper.check_properties(this, {
'GamepadPose': [
'hasOrientation',
'hasPosition',
'position',
'linearVelocity',
'linearAcceleration',
'orientation',
'angularVelocity',
'angularAcceleration'
]
});
}, 'Additional Gamepad Extensions interfaces and their properties are available.');
</script>