Commit e7d844da authored by bsheedy's avatar bsheedy Committed by Commit Bot

Remove VrCore-side head tracking

Removes the code for using the VrCore-side fake head tracking service
in VR tests. This functionality was added a long time ago, but never
actually used because enabling it caused VrCore to crash randomly.

Equivalent functionality has been around on Chrome's end for a while.

Bug: 931414
Change-Id: Icb7c4931b177d1357368add1e915103bfeaef71e
Reviewed-on: https://chromium-review.googlesource.com/c/1471511Reviewed-by: default avatarKlaus Weidner <klausw@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632756}
parent 46451301
......@@ -854,12 +854,10 @@ if (enable_vr || (enable_arcore && package_arcore)) {
"javatests/src/org/chromium/chrome/browser/vr/nfc_apk/SimNfcActivity.java",
"javatests/src/org/chromium/chrome/browser/vr/rules/ChromeTabbedActivityVrTestRule.java",
"javatests/src/org/chromium/chrome/browser/vr/rules/CustomTabActivityVrTestRule.java",
"javatests/src/org/chromium/chrome/browser/vr/rules/HeadTrackingMode.java",
"javatests/src/org/chromium/chrome/browser/vr/rules/VrActivityRestrictionRule.java",
"javatests/src/org/chromium/chrome/browser/vr/rules/VrSettingsFile.java",
"javatests/src/org/chromium/chrome/browser/vr/rules/VrTestRule.java",
"javatests/src/org/chromium/chrome/browser/vr/rules/WebappActivityVrTestRule.java",
"javatests/src/org/chromium/chrome/browser/vr/util/HeadTrackingUtils.java",
"javatests/src/org/chromium/chrome/browser/vr/util/NativeUiUtils.java",
"javatests/src/org/chromium/chrome/browser/vr/util/NfcSimUtils.java",
"javatests/src/org/chromium/chrome/browser/vr/util/RenderTestUtils.java",
......
......@@ -28,7 +28,6 @@ import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.preferences.website.ContentSettingValues;
import org.chromium.chrome.browser.preferences.website.PermissionInfo;
import org.chromium.chrome.browser.vr.rules.ChromeTabbedActivityVrTestRule;
import org.chromium.chrome.browser.vr.rules.HeadTrackingMode;
import org.chromium.chrome.browser.vr.util.NativeUiUtils;
import org.chromium.chrome.browser.vr.util.RenderTestUtils;
import org.chromium.chrome.browser.vr.util.VrBrowserTransitionUtils;
......@@ -165,7 +164,6 @@ public class VrBrowserDialogTest {
*/
@Test
@LargeTest
@HeadTrackingMode(HeadTrackingMode.SupportedMode.FROZEN)
@Feature({"Browser", "RenderTest"})
public void testMicrophonePermissionPrompt()
throws InterruptedException, TimeoutException, IOException {
......@@ -180,7 +178,6 @@ public class VrBrowserDialogTest {
*/
@Test
@LargeTest
@HeadTrackingMode(HeadTrackingMode.SupportedMode.FROZEN)
@Feature({"Browser", "RenderTest"})
@Restriction(RESTRICTION_TYPE_VIEWER_DAYDREAM)
public void testCameraPermissionPrompt()
......@@ -195,7 +192,6 @@ public class VrBrowserDialogTest {
*/
@Test
@LargeTest
@HeadTrackingMode(HeadTrackingMode.SupportedMode.FROZEN)
@Feature({"Browser", "RenderTest"})
public void testLocationPermissionPrompt()
throws InterruptedException, TimeoutException, IOException {
......@@ -210,7 +206,6 @@ public class VrBrowserDialogTest {
*/
@Test
@LargeTest
@HeadTrackingMode(HeadTrackingMode.SupportedMode.FROZEN)
@Feature({"Browser", "RenderTest"})
public void testNotificationPermissionPrompt()
throws InterruptedException, TimeoutException, IOException {
......
......@@ -21,7 +21,6 @@ import org.chromium.chrome.test.ChromeTabbedActivityTestRule;
*/
public class ChromeTabbedActivityVrTestRule
extends ChromeTabbedActivityTestRule implements VrTestRule {
private boolean mTrackerDirty;
private boolean mDonEnabled;
@Override
......@@ -43,16 +42,6 @@ public class ChromeTabbedActivityVrTestRule
return SupportedActivity.CTA;
}
@Override
public boolean isTrackerDirty() {
return mTrackerDirty;
}
@Override
public void setTrackerDirty() {
mTrackerDirty = true;
}
@Override
public boolean isDonEnabled() {
return mDonEnabled;
......
......@@ -20,7 +20,6 @@ import org.chromium.chrome.browser.vr.util.VrTestRuleUtils;
* opens up a CustomTabActivity to a blank page while performing some additional VR-only setup.
*/
public class CustomTabActivityVrTestRule extends CustomTabActivityTestRule implements VrTestRule {
private boolean mTrackerDirty;
private boolean mDonEnabled;
@Override
......@@ -46,16 +45,6 @@ public class CustomTabActivityVrTestRule extends CustomTabActivityTestRule imple
return SupportedActivity.CCT;
}
@Override
public boolean isTrackerDirty() {
return mTrackerDirty;
}
@Override
public void setTrackerDirty() {
mTrackerDirty = true;
}
@Override
public boolean isDonEnabled() {
return mDonEnabled;
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.vr.rules;
import android.support.annotation.IntDef;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* An annotation for setting the VrCore head tracking service's tracking mode during pre-test setup.
*
* The benefit of setting the mode this way instead of via HeadTrackingUtils during a test is that
* starting services is asynchronous with no good way of waiting until whatever the service does
* takes effect. When set during a test, the test must idle long enough to safely assume that the
* service has taken effect. When applied during test setup, the Chrome startup period acts as the
* wait, as Chrome startup is slow enough that it's safe to assume the service has started by the
* time Chrome is ready.
*
* For example, the following would cause a test to start with its head position locked looking
* straight forward:
* <code>
* @HeadTrackingMode(HeadTrackingMode.SupportedMode.FROZEN)
* </code>
* If a test is not annotated with this, it will use whatever mode is currently set. This should
* usually be the normal, sensor-based tracker, but is not guaranteed.
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface HeadTrackingMode {
@IntDef({SupportedMode.FROZEN, SupportedMode.SWEEP, SupportedMode.ROTATE,
SupportedMode.CIRCLE_STRAFE, SupportedMode.MOTION_SICKNESS})
@Retention(RetentionPolicy.RUNTIME)
public @interface SupportedMode {
int FROZEN = 0; // Locked looking straight forward.
int SWEEP = 1; // Rotates back and forth horizontally in a 180 degree arc.
int ROTATE = 2; // Rotates 360 degrees.
int CIRCLE_STRAFE = 3; // Rotates 360 degrees, and if 6DOF is supported, changes position.
int MOTION_SICKNESS = 4; // Moves in a figure-eight-like pattern.
}
/**
* @return The supported mode.
*/
public @SupportedMode int value();
}
......@@ -10,18 +10,6 @@ package org.chromium.chrome.browser.vr.rules;
* clean up the fake head pose tracker.
*/
public interface VrTestRule extends XrTestRule {
/**
* Whether the head tracking mode has been changed.
*
* @return True if the head tracking mode has been changed, false otherwise.
*/
public boolean isTrackerDirty();
/**
* Tells the rule that the head tracking mode has been changed.
*/
public void setTrackerDirty();
/**
* Whether the currently applied settings result in the DON flow being enabled.
* @return True if the DON flow is enabled, false otherwise.
......
......@@ -19,7 +19,6 @@ import org.chromium.chrome.browser.webapps.WebappActivityTestRule;
* up a WebappActivity to a blank page while performing some additional VR-only setup.
*/
public class WebappActivityVrTestRule extends WebappActivityTestRule implements VrTestRule {
private boolean mTrackerDirty;
private boolean mDonEnabled;
@Override
......@@ -41,16 +40,6 @@ public class WebappActivityVrTestRule extends WebappActivityTestRule implements
return SupportedActivity.WAA;
}
@Override
public boolean isTrackerDirty() {
return mTrackerDirty;
}
@Override
public void setTrackerDirty() {
mTrackerDirty = true;
}
@Override
public boolean isDonEnabled() {
return mDonEnabled;
......
......@@ -66,7 +66,6 @@ public class VrTestRuleUtils extends XrTestRuleUtils {
TestVrShellDelegate.setDescription(desc);
VrTestRuleUtils.ensureNoVrActivitiesDisplayed();
HeadTrackingUtils.checkForAndApplyHeadTrackingModeAnnotation(rule, desc);
launcher.launch();
// Must be called after Chrome is started, as otherwise startService fails with an
// IllegalStateException for being used from a backgrounded app.
......@@ -83,11 +82,7 @@ public class VrTestRuleUtils extends XrTestRuleUtils {
VrFeedbackStatus.setUserExitedAndEntered2DCount(0);
}
try {
base.evaluate();
} finally {
if (rule.isTrackerDirty()) HeadTrackingUtils.revertTracker();
}
base.evaluate();
}
/**
......
......@@ -117,8 +117,7 @@ blank page and implement a method that allows it to work with
`XrActivityRestrictionRule`.
Rules that implement `VrTestRule` do the same, but also perform some additional
VR-specific setup such as ensuring that the test is not started in VR and
allowing the use of the experimental/broken VrCore head tracking service.
VR-specific setup such as ensuring that the test is not started in VR.
## Dynamic VrCore Settings
......
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