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

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

Issue 2768583002: Make VR screen tap tests more stable (Closed)
Patch Set: Lower duration for DD, change behavior for cardboard 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
« no previous file with comments | « no previous file | chrome/test/data/android/webvr_instrumentation/html/test_screen_taps_not_registered_on_daydream.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 017d116dd6003235b5b1b7c751dec1f7761e8bce..ad7d9be8cdabfeb6c31472f54b9aecc03206ca6a 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
@@ -8,6 +8,7 @@ import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_V
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.os.SystemClock;
import android.support.test.filters.SmallTest;
import org.chromium.base.Log;
@@ -257,7 +258,14 @@ public class WebVrTest extends ChromeTabbedActivityTestBase {
assertTrue("VRDisplay found", vrDisplayFound(mWebContents));
executeStepAndWait("stepVerifyNoInitialTaps()", mWebContents);
enterVrTapAndWait(mWebContents);
- enterVrTap();
+ // Checking for a tap in Javascript immediately after sending one can result
+ // in the check happening before the click event is fired, which would cause
+ // this test to pass even if the click would have been registered. Solution
+ // is to send several over a short period to make sure there's enough time
+ for (int i = 0; i < 5; i++) {
Ted C 2017/03/27 15:44:06 What is the goal of the test? Are we trying to se
bsheedy 2017/03/27 20:19:12 The purpose is to test that tapping on the screen
+ enterVrTap();
+ SystemClock.sleep(50);
+ }
executeStepAndWait("stepVerifyNoAdditionalTaps()", mWebContents);
endTest(mWebContents);
}
@@ -273,9 +281,10 @@ public class WebVrTest extends ChromeTabbedActivityTestBase {
loadUrl(getHtmlTestFile(testName), 10);
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);
}
« no previous file with comments | « no previous file | chrome/test/data/android/webvr_instrumentation/html/test_screen_taps_not_registered_on_daydream.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698