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

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

Issue 2782963002: Revert of Make VR screen tap tests more stable (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 b62ab96a94daf5c7b542b92cea21301b426efeb7..04bb75a72477136a9415c69d4736545e4efe5d5a 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
@@ -12,8 +12,6 @@
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.LargeTest;
-import android.support.test.filters.MediumTest;
import android.support.test.filters.SmallTest;
import org.chromium.base.Log;
@@ -28,7 +26,6 @@
import org.chromium.content_public.browser.WebContents;
import java.util.concurrent.Callable;
-import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
@@ -255,7 +252,7 @@
* Tests that screen touches are not registered when the viewer is a
* Daydream View.
*/
- @LargeTest
+ @SmallTest
@Restriction(RESTRICTION_TYPE_VIEWER_DAYDREAM)
public void testScreenTapsNotRegisteredOnDaydream() throws InterruptedException {
String testName = "test_screen_taps_not_registered_on_daydream";
@@ -263,22 +260,7 @@
assertTrue("VRDisplay found", vrDisplayFound(mWebContents));
executeStepAndWait("stepVerifyNoInitialTaps()", mWebContents);
enterVrTapAndWait(mWebContents);
- // Wait on VrShellImpl to say that its parent consumed the touch event
- // Set to 2 because there's an ACTION_DOWN followed by ACTION_UP
- final CountDownLatch touchRegisteredLatch = new CountDownLatch(2);
- ((VrShellImpl) VrShellDelegate.getVrShellForTesting())
- .setOnDispatchTouchEventForTesting(new OnDispatchTouchEventCallback() {
- @Override
- public void onDispatchTouchEvent(
- boolean parentConsumed, boolean cardboardTriggered) {
- if (!parentConsumed) fail("Parent did not consume event");
- if (cardboardTriggered) fail("Cardboard event triggered");
- touchRegisteredLatch.countDown();
- }
- });
enterVrTap();
- assertTrue("VrShellImpl dispatched touches",
- touchRegisteredLatch.await(POLL_TIMEOUT_SHORT_MS, TimeUnit.MILLISECONDS));
executeStepAndWait("stepVerifyNoAdditionalTaps()", mWebContents);
endTest(mWebContents);
}
@@ -287,17 +269,16 @@
* Tests that screen touches are still registered when the viewer is
* Cardboard.
*/
- @MediumTest
+ @SmallTest
@Restriction(RESTRICTION_TYPE_VIEWER_NON_DAYDREAM)
public void testScreenTapsRegisteredOnCardboard() throws InterruptedException {
String testName = "test_screen_taps_registered_on_cardboard";
loadUrl(getHtmlTestFile(testName), PAGE_LOAD_TIMEOUT_S);
assertTrue("VRDisplay found", vrDisplayFound(mWebContents));
executeStepAndWait("stepVerifyNoInitialTaps()", mWebContents);
- // Tap and wait to enter VR
enterVrTapAndWait(mWebContents);
- // Tap and wait for Javascript to receive it
- enterVrTapAndWait(mWebContents);
+ enterVrTap();
+ executeStepAndWait("stepVerifyAdditionalTap()", mWebContents);
endTest(mWebContents);
}

Powered by Google App Engine
This is Rietveld 408576698