Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java

Issue 2753303002: Add screen tap WebVR tests (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java
index a667832f5ae232e25fd048c7b28bd99b9e858e67..017d116dd6003235b5b1b7c751dec1f7761e8bce 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/WebVrTest.java
@@ -4,7 +4,8 @@
package org.chromium.chrome.browser.vr_shell;
-import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_DAYDREAM_VIEW;
+import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_VIEWER_DAYDREAM;
+import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_VIEWER_NON_DAYDREAM;
import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_WEBVR_SUPPORTED;
import android.support.test.filters.SmallTest;
@@ -137,7 +138,7 @@ public class WebVrTest extends ChromeTabbedActivityTestBase {
String result = "false";
try {
result = JavaScriptUtils.executeJavaScriptAndWaitForResult(
- webContents, "testPassed", 50, TimeUnit.MILLISECONDS);
+ webContents, "testPassed", 1000, TimeUnit.MILLISECONDS);
} catch (InterruptedException | TimeoutException e) {
// Do nothing - if it times out, the test will be marked as failed
}
@@ -147,7 +148,7 @@ public class WebVrTest extends ChromeTabbedActivityTestBase {
try {
result = JavaScriptUtils.executeJavaScriptAndWaitForResult(
- webContents, "resultString", 50, TimeUnit.MILLISECONDS);
+ webContents, "resultString", 1000, TimeUnit.MILLISECONDS);
} catch (InterruptedException | TimeoutException e) {
result = "Unable to retrieve failure reason";
}
@@ -236,7 +237,7 @@ public class WebVrTest extends ChromeTabbedActivityTestBase {
* fires the vrdisplayactivate event.
*/
@SmallTest
- @Restriction(RESTRICTION_TYPE_DAYDREAM_VIEW)
+ @Restriction(RESTRICTION_TYPE_VIEWER_DAYDREAM)
public void testNfcFiresVrdisplayactivate() throws InterruptedException {
String testName = "test_nfc_fires_vrdisplayactivate";
loadUrl(getHtmlTestFile(testName), 10);
@@ -245,6 +246,40 @@ public class WebVrTest extends ChromeTabbedActivityTestBase {
}
/**
+ * Tests that screen touches are not registered when the viewer is a
+ * Daydream View.
+ */
+ @SmallTest
+ @Restriction(RESTRICTION_TYPE_VIEWER_DAYDREAM)
+ public void testScreenTapsNotRegisteredOnDaydream() throws InterruptedException {
+ String testName = "test_screen_taps_not_registered_on_daydream";
+ loadUrl(getHtmlTestFile(testName), 10);
+ assertTrue("VRDisplay found", vrDisplayFound(mWebContents));
+ executeStepAndWait("stepVerifyNoInitialTaps()", mWebContents);
+ enterVrTapAndWait(mWebContents);
+ enterVrTap();
+ executeStepAndWait("stepVerifyNoAdditionalTaps()", mWebContents);
+ endTest(mWebContents);
+ }
+
+ /**
+ * Tests that screen touches are still registered when the viewer is
+ * Cardboard.
+ */
+ @SmallTest
+ @Restriction(RESTRICTION_TYPE_VIEWER_NON_DAYDREAM)
+ public void testScreenTapsRegisteredOnCardboard() throws InterruptedException {
+ String testName = "test_screen_taps_registered_on_cardboard";
+ loadUrl(getHtmlTestFile(testName), 10);
+ assertTrue("VRDisplay found", vrDisplayFound(mWebContents));
+ executeStepAndWait("stepVerifyNoInitialTaps()", mWebContents);
+ enterVrTapAndWait(mWebContents);
+ enterVrTap();
+ executeStepAndWait("stepVerifyAdditionalTap()", mWebContents);
+ endTest(mWebContents);
+ }
+
+ /**
* Tests that non-focused tabs cannot get pose information.
*/
@SmallTest

Powered by Google App Engine
This is Rietveld 408576698