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

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

Issue 1063853005: Unify Android Webview and Chrome's fling (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: add a todo Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.content.browser; 5 package org.chromium.content.browser;
6 6
7 import android.content.res.Configuration; 7 import android.content.res.Configuration;
8 import android.graphics.Canvas; 8 import android.graphics.Canvas;
9 import android.os.SystemClock; 9 import android.os.SystemClock;
10 import android.test.suitebuilder.annotation.SmallTest; 10 import android.test.suitebuilder.annotation.SmallTest;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 : getContentViewCore().getNativeScrollYForTest() > maxTh reshold; 115 : getContentViewCore().getNativeScrollYForTest() > maxTh reshold;
116 return xCorrect && yCorrect; 116 return xCorrect && yCorrect;
117 } 117 }
118 })); 118 }));
119 } 119 }
120 120
121 private void fling(final int vx, final int vy) throws Throwable { 121 private void fling(final int vx, final int vy) throws Throwable {
122 runTestOnUiThread(new Runnable() { 122 runTestOnUiThread(new Runnable() {
123 @Override 123 @Override
124 public void run() { 124 public void run() {
125 getContentViewCore().flingForTest(SystemClock.uptimeMillis(), 0, 0, vx, vy); 125 getContentViewCore().fling(SystemClock.uptimeMillis(), 0, 0, vx, vy);
126 } 126 }
127 }); 127 });
128 } 128 }
129 129
130 private void scrollTo(final int x, final int y) throws Throwable { 130 private void scrollTo(final int x, final int y) throws Throwable {
131 runTestOnUiThread(new Runnable() { 131 runTestOnUiThread(new Runnable() {
132 @Override 132 @Override
133 public void run() { 133 public void run() {
134 getContentViewCore().getContainerView().scrollTo(x, y); 134 getContentViewCore().getContainerView().scrollTo(x, y);
135 } 135 }
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 scrollTo(scrollToX, scrollToY); 293 scrollTo(scrollToX, scrollToY);
294 assertWaitForScroll(false, false); 294 assertWaitForScroll(false, false);
295 assertTrue(CriteriaHelper.pollForCriteria(new Criteria() { 295 assertTrue(CriteriaHelper.pollForCriteria(new Criteria() {
296 @Override 296 @Override
297 public boolean isSatisfied() { 297 public boolean isSatisfied() {
298 return containerViewInternals.isScrollChanged(); 298 return containerViewInternals.isScrollChanged();
299 } 299 }
300 })); 300 }));
301 } 301 }
302 } 302 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698