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

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/ContentViewScrollingTest.java

Issue 1571043002: Simplify joystick scrolling code and reenable test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address code review comments Created 4 years, 11 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: content/public/android/javatests/src/org/chromium/content/browser/ContentViewScrollingTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewScrollingTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewScrollingTest.java
index a73cf9b629567ea2336351b9039210c8a1a13d44..f1176e638c2b4fe42496d79ed77bc930c40fef26 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewScrollingTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewScrollingTest.java
@@ -13,7 +13,6 @@ import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
-import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.UrlUtils;
import org.chromium.content.browser.ContentViewCore.InternalAccessDelegate;
@@ -263,55 +262,32 @@ public class ContentViewScrollingTest extends ContentShellTestBase {
assertWaitForScroll(false, false);
}
- /*
@SmallTest
- @RerunWithUpdatedContainerView
@Feature({"Main"})
- crbug.com/538781
- */
- @DisabledTest
public void testJoystickScroll() throws Throwable {
scrollTo(0, 0);
assertWaitForScroll(true, true);
- // No scroll
- scrollWithJoystick(0f, 0f);
- assertWaitForScroll(true, true);
-
- // Verify no scrolling when X axis motion falls in deadzone.
- // TODO(jdduke): Make the deadzone scroll checks non-racy.
- scrollWithJoystick(0.2f, 0f);
- assertWaitForScroll(true, true);
-
- // Verify no scrolling when Y axis motion falls in deadzone.
- scrollWithJoystick(0f, 0.2f);
- assertWaitForScroll(true, true);
-
- // Vertical scroll to lower-left.
- scrollWithJoystick(0, 0.5f);
+ // Scroll with X axis in deadzone and the Y axis active.
+ // Only the Y axis should have an effect, arriving at lower-left.
+ scrollWithJoystick(0.1f, 1f);
assertWaitForScroll(true, false);
- // Send joystick event at origin to stop scrolling.
- scrollWithJoystick(0f, 0f);
- // Horizontal scroll to lower-right.
- scrollWithJoystick(0.5f, 0);
+ // Scroll with Y axis in deadzone and the X axis active.
+ scrollWithJoystick(1f, -0.1f);
assertWaitForScroll(false, false);
- scrollWithJoystick(0f, 0f);
// Vertical scroll to upper-right.
scrollWithJoystick(0, -0.75f);
assertWaitForScroll(false, true);
- scrollWithJoystick(0f, 0f);
// Horizontal scroll to top-left.
scrollWithJoystick(-0.75f, 0);
assertWaitForScroll(true, true);
- scrollWithJoystick(0f, 0f);
// Diagonal scroll to bottom-right.
scrollWithJoystick(1f, 1f);
assertWaitForScroll(false, false);
- scrollWithJoystick(0f, 0f);
}
/**

Powered by Google App Engine
This is Rietveld 408576698