Commit 173bbfd7 authored by bsheedy's avatar bsheedy Committed by Commit Bot

Deduplicate WebXR tests

Deduplicates most WebVR/WebXR tests into one test implementation that
takes different arguments for WebVR and WebXR.

Bug: 804043
Change-Id: I1486a4d8e75d91fe98c1298f3b528df4bc01d938
Reviewed-on: https://chromium-review.googlesource.com/896800
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Reviewed-by: default avatarMichael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533890}
parent a5252e85
......@@ -638,8 +638,6 @@ if (enable_vr) {
"javatests/src/org/chromium/chrome/browser/vr_shell/WebVrInputTest.java",
"javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTabTest.java",
"javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTransitionTest.java",
"javatests/src/org/chromium/chrome/browser/vr_shell/WebXrInputTest.java",
"javatests/src/org/chromium/chrome/browser/vr_shell/WebXrTransitionTest.java",
"javatests/src/org/chromium/chrome/browser/vr_shell/XrTestFramework.java",
"javatests/src/org/chromium/chrome/browser/webapps/TestFetchStorageCallback.java",
"javatests/src/org/chromium/chrome/browser/webapps/WebappActivityTestRule.java",
......
......@@ -22,6 +22,7 @@ import org.chromium.chrome.browser.vr_shell.TestVrShellDelegate;
import org.chromium.chrome.browser.vr_shell.VrClassesWrapperImpl;
import org.chromium.chrome.browser.vr_shell.VrIntentUtils;
import org.chromium.chrome.browser.vr_shell.VrShellDelegate;
import org.chromium.chrome.browser.vr_shell.VrTestFramework;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
......@@ -121,6 +122,18 @@ public class TransitionUtils {
TestFramework.waitOnJavaScriptStep(webContents);
}
/**
* Allows the use of enterPresentationOrFail for shared WebVR and WebXR tests without having to
* check whether we need to use the WebVR or WebXR version every time.
*/
public static void enterPresentationOrFail(TestFramework framework) {
if (framework instanceof VrTestFramework) {
VrTransitionUtils.enterPresentationOrFail(framework.getFirstTabCvc());
} else {
XrTransitionUtils.enterPresentationOrFail(framework.getFirstTabCvc());
}
}
/**
* @return Whether the VR back button is enabled.
*/
......
<!doctype html>
<!-- 2D page to test transitions. -->
<html>
<body>
<input type="checkbox" onclick="setFullscreen(this)" id="fullscreen">Fullscreen
<script src="../resources/webvr_e2e.js"></script>
<script src="../resources/navigation_e2e.js"></script>
</body>
</html>
......@@ -15,12 +15,13 @@ focus, that the presenting frame still receives input.
<script>
var t = async_test("Focus is locked to presentation");
var rafCount = 0;
window.addEventListener("vrdisplaypresentchange", () => {
function stepSetupFocusLoss() {
onPresentingAnimationFrameCallback = null;
setTimeout(function() {
document.getElementById('externalframe').contentWindow.focus();
}, 1000);
}, false);
}
window.onblur = function() {
onPresentingAnimationFrameCallback = function() {
......
......@@ -13,8 +13,6 @@ Tests that screen taps aren't registered while in VR
<script src="../resources/webvr_boilerplate.js"></script>
<script>
var t = async_test("Screen taps not registered when in VR");
window.addEventListener("vrdisplaypresentchange",
() => {finishJavaScriptStep();}, false);
var numTaps = 0;
webglCanvas.addEventListener("click", () => {numTaps++;}, false);
......
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