diff options
author | newt@chromium.org <newt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-12 21:59:41 +0000 |
---|---|---|
committer | newt@chromium.org <newt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-12 21:59:41 +0000 |
commit | d8b8d923b5903bc8b072a50b238a7083f1f2bc3d (patch) | |
tree | 27e6609b7cff562002ed4c047331d6a5eadf32e0 /content/public/test | |
parent | bfa2c6062fcb3ef2abaaf6ab4a16a7bf383c8b7b (diff) | |
download | chromium_src-d8b8d923b5903bc8b072a50b238a7083f1f2bc3d.zip chromium_src-d8b8d923b5903bc8b072a50b238a7083f1f2bc3d.tar.gz chromium_src-d8b8d923b5903bc8b072a50b238a7083f1f2bc3d.tar.bz2 |
Add longClickView() to TestTouchUtils.
Often in tests we just need to click the middle of a view, so add a
method to do that.
R=dtrainor@chromium.org
Review URL: https://codereview.chromium.org/67813011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234646 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/public/test')
-rw-r--r-- | content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestTouchUtils.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestTouchUtils.java b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestTouchUtils.java index 2a2c860..0cf2b56 100644 --- a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestTouchUtils.java +++ b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestTouchUtils.java @@ -111,6 +111,18 @@ public class TestTouchUtils extends android.test.TouchUtils { } /** + * Sends (synchronously) a long click to the View at its center. + * + * @param instrumentation Instrumentation object used by the test. + * @param v The view to long click. + */ + public static void longClickView(Instrumentation instrumentation, View v) { + int x = v.getWidth() / 2; + int y = v.getHeight() / 2; + longClickView(instrumentation, v, x, y); + } + + /** * Starts (synchronously) a drag motion. Normally followed by dragTo() and dragEnd(). * * @param instrumentation Instrumentation object used by the test. |