Chromium Code Reviews| 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); |
| } |