Commit 1ac67ba2 authored by Anna Offenwanger's avatar Anna Offenwanger Committed by Commit Bot

Add tests for WebXR and WebVR origin trials.

Adding tests as per request of the origin trial team.

Bug: 832387
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Ie7d09c127f46d7de2928388d69712b2c73fdd630
Reviewed-on: https://chromium-review.googlesource.com/1003041Reviewed-by: default avatarBrandon Jones <bajones@chromium.org>
Reviewed-by: default avatarJason Chase <chasej@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarDavid Dorwin <ddorwin@chromium.org>
Commit-Queue: Anna Offenwanger <offenwanger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551179}
parent c590f236
...@@ -204,8 +204,8 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( ...@@ -204,8 +204,8 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
if (command_line.HasSwitch(switches::kEnableWebVR)) if (command_line.HasSwitch(switches::kEnableWebVR))
WebRuntimeFeatures::EnableWebVR(true); WebRuntimeFeatures::EnableWebVR(true);
WebRuntimeFeatures::EnableWebXR( if (base::FeatureList::IsEnabled(features::kWebXr))
base::FeatureList::IsEnabled(features::kWebXr)); WebRuntimeFeatures::EnableWebXR(true);
if (base::FeatureList::IsEnabled(features::kWebXrGamepadSupport)) if (base::FeatureList::IsEnabled(features::kWebXrGamepadSupport))
WebRuntimeFeatures::EnableWebXRGamepadSupport(true); WebRuntimeFeatures::EnableWebXRGamepadSupport(true);
......
...@@ -253,7 +253,10 @@ class WebGLConformanceIntegrationTest(gpu_integration_test.GpuIntegrationTest): ...@@ -253,7 +253,10 @@ class WebGLConformanceIntegrationTest(gpu_integration_test.GpuIntegrationTest):
# Try disabling the GPU watchdog to see if this affects the # Try disabling the GPU watchdog to see if this affects the
# intermittent GPU process hangs that have been seen on the # intermittent GPU process hangs that have been seen on the
# waterfall. crbug.com/596622 crbug.com/609252 # waterfall. crbug.com/596622 crbug.com/609252
'--disable-gpu-watchdog' '--disable-gpu-watchdog',
# TODO(http://crbug.com/832952): Remove this when WebXR spec is more
# stable and setCompatibleXRDevice is part of the conformance test.
'--disable-blink-features=WebXR'
] ]
# Note that the overriding of the default --js-flags probably # Note that the overriding of the default --js-flags probably
# won't interact well with RestartBrowserIfNecessaryWithArgs, but # won't interact well with RestartBrowserIfNecessaryWithArgs, but
......
<!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', 'vibrationActuator', 'hand', 'displayId'],
'GamepadButton': ['touched'],
};
interfaces_to_check = [
'GamepadPose',
'GamepadHapticActuator'
];
// 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'
],
'GamepadHapticActuator': ['type', 'playEffect', 'reset']
});
}, 'Additional Gamepad Extensions interfaces and their properties are available.');
</script>
<!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 properties_to_check = {
'Navigator': ['getVRDisplays']
}
const token="AjBmNGyEfNhgv1i84o2MDXzBna5hynT2UdRWh24E6smvQuM6lTjdHiORSsixiR6wo8A4AZofrxgIT6RYIjwg2AMAAABTeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiV2ViVlIxLjFNNjIiLCAiZXhwaXJ5IjogMjAwMDAwMDAwMH0=";
// Skip this test if flags are not set properly.
if(!self.internals.runtimeFlags.webVREnabled) {
test(t => {
OriginTrialsHelper.check_properties_missing(this, properties_to_check);
}, "WebVR properties are not available without a token.");
}
OriginTrialsHelper.add_token(token);
test(t => {
OriginTrialsHelper.check_properties(this, properties_to_check);
}, 'WebVR properties are available.');
test(t => {
OriginTrialsHelper.check_properties(this, {
'Navigator': ['getVRDisplays'],
'VRDisplay':[
'displayId',
'displayName',
'isPresenting',
'capabilities',
'stageParameters',
'getFrameData',
'depthNear',
'depthFar',
'getEyeParameters',
'requestAnimationFrame',
'cancelAnimationFrame',
'requestPresent',
'exitPresent',
'getLayers',
'submitFrame'
],
'VRDisplayEvent':['display', 'reason'],
'VREyeParameters':['renderWidth', 'renderHeight', 'offset'],
'VRFrameData':[
'leftProjectionMatrix',
'leftViewMatrix',
'rightProjectionMatrix',
'rightViewMatrix',
'pose'
],
'VRPose':[
'position',
'linearVelocity',
'linearAcceleration',
'orientation',
'angularVelocity',
'angularAcceleration',
],
'VRStageParameters':[
'sittingToStandingTransform',
'sizeX',
'sizeZ'
],
'VRDisplayCapabilities':[
'canPresent',
'hasPosition',
'hasExternalDisplay',
'maxLayers'
],
});
}, 'All WebVR interfaces and properties are available.');
</script>
<!DOCTYPE html>
<meta charset="utf-8">
<!-- Generate token with the command:
generate_token.py http://127.0.0.1:8000 WebXRGamepadSupport --expire-timestamp=2000000000
To test whether the token is working, run virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/xr tests.
-->
<title>WebXRGamepadSupport - 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="AmQCIm7DYplQu/Vuep/62Rwyu+gYKwA1kz4CkNQWwtUnkr4o+kHqiSBZYD6APsbzyDDKm5xKi4BH4MxnheS8qwIAAABbeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiV2ViWFJHYW1lcGFkU3VwcG9ydCIsICJleHBpcnkiOiAyMDAwMDAwMDAwfQ==";
const properties_to_check = {
'Gamepad': ['hand', 'displayId'],
'GamepadButton': ['touched'],
}
// Skip this test if flags are not set properly.
if(!self.internals.runtimeFlags.webXRGamepadSupportEnabled) {
test(t => {
OriginTrialsHelper.check_properties_missing(this, properties_to_check);
}, "Additional WebXR Gamepad Support properties are not available without a token.");
}
OriginTrialsHelper.add_token(token);
test(t => {
OriginTrialsHelper.check_properties(this, properties_to_check);
}, 'Additional WebXR Gamepad Support properties are available.');
</script>
<!DOCTYPE html>
<meta charset="utf-8">
<!-- Generate token with the command:
generate_token.py http://127.0.0.1:8000 WebXRDevice --expire-timestamp=2000000000
To test whether the token is working, run virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/xr tests.
-->
<title>WebXRDevice - 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>
let token = "AhQSpjyHBWIyc+JFceIXXbRu6uibOv1f3BsZBP4sc3JNyuINgalHc4xBSLNvlJ7uR4p+qMI0kVWc5yHljKHTWQEAAABTeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiV2ViWFJEZXZpY2UiLCAiZXhwaXJ5IjogMjAwMDAwMDAwMH0=";
let properties_to_check = {'Navigator': ['xr']};
// Skip this test if flags are not set properly.
if(!self.internals.runtimeFlags.webXREnabled) {
test(t => {
OriginTrialsHelper.check_properties_missing(this, properties_to_check);
}, "WebXR's entrypoint properties are not available without a token.");
}
OriginTrialsHelper.add_token(token);
test(t => {
OriginTrialsHelper.check_properties(this, properties_to_check);
}, "WebXR's entrypoint properties are available.");
</script>
...@@ -526,7 +526,7 @@ ...@@ -526,7 +526,7 @@
{ {
name: "GamepadExtensions", name: "GamepadExtensions",
origin_trial_feature_name: "WebVR1.1M62", origin_trial_feature_name: "WebVR1.1M62",
status: "test", status: "experimental",
}, },
{ {
name: "GeometryInterfaces", name: "GeometryInterfaces",
...@@ -1322,7 +1322,7 @@ ...@@ -1322,7 +1322,7 @@
{ {
name: "WebVR", name: "WebVR",
origin_trial_feature_name: "WebVR1.1M62", origin_trial_feature_name: "WebVR1.1M62",
status: "test", status: "experimental",
}, },
{ {
name: "WebVTTRegions", name: "WebVTTRegions",
...@@ -1331,7 +1331,7 @@ ...@@ -1331,7 +1331,7 @@
{ {
name: "WebXR", name: "WebXR",
origin_trial_feature_name: "WebXRDevice", origin_trial_feature_name: "WebXRDevice",
status: "test", status: "experimental",
}, },
// Subset of the GamepadExtensions wanted for WebXR, which expose VR controller // Subset of the GamepadExtensions wanted for WebXR, which expose VR controller
// functionality as Gamepads. // functionality as Gamepads.
...@@ -1340,7 +1340,7 @@ ...@@ -1340,7 +1340,7 @@
origin_trial_feature_name: "WebXRGamepadSupport", origin_trial_feature_name: "WebXRGamepadSupport",
// This feature is a strict subset of GamepadExtensions. // This feature is a strict subset of GamepadExtensions.
implied_by: ["GamepadExtensions"], implied_by: ["GamepadExtensions"],
status: "test", status: "experimental",
}, },
{ {
name: "WorkerNosniffBlock", name: "WorkerNosniffBlock",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment